This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Question script

Old posts that have not been replied to for several years.
Locked
s
sirgrim

Post by sirgrim »

Basically this script will just have a channel setup for question review by a team, then it's passed to the main channel when accepted, or sends a message if denied, here is what I have so far if anyone could patch it up or give me some suggestions so it works I would appreciate it, I can't remember how to pass the question between the procs.

### OutPut Channel ###
set ochan "#Lamest"
### Question Channel ###
set qchan "#WAGD"

bind msg - Question: pub_msg
bind pub m Accept pub_Accept
bind pub m Deny pub_Deny

proc pub_msg {nick uhost hand arg} {
global ochan qchan
set question [string trim $arg]
puthelp "PRIVMSG $ochan :$nick has submitted a question! Here it is!"
puthelp "PRIVMSG $ochan :$nick: $question."
puthelp "PRIVMSG $ochan :If you accept this question, type 'Accept', if you reject it, type 'Deny'."
}

proc pub_Accept {nick host handle channel args} {
global ochan qchan question
putserv "PRIVMSG $qchan :$nick: $question"
return 1
}

proc pub_Deny {nick host handle channel args} {
global ochan qchan
putserv "PRIVMSG $nick :Your message did not meet needed requirements. Thanks for your time"
return 1
}

s
sirgrim

Post by sirgrim »

Well this works if I ghetto it to a file, but there's probably a more efficient way.

### OutPut Channel ###
set ochan "#Lamest"
### Question Channel ###
set qchan "#WAGD"

### Question File ###
set location "/tmp/questions.$qchan"

bind msg - Question: pub_msg
bind pub m Accept pub_Accept
bind pub m Deny pub_Deny

proc pub_msg {nick uhost hand arg} {
global ochan qchan location
set question [string trim $arg]
puthelp "[exec echo $question >> $location]"
puthelp "PRIVMSG $ochan :$nick has submitted a question! Here it is!"
puthelp "PRIVMSG $ochan :$nick: $question."
puthelp "PRIVMSG $ochan :If you accept this question, type 'Accept', if you reject it, type 'Deny'."
}

proc pub_Accept {nick host handle channel args} {
global ochan qchan question location
set question [exec cat $location]
putserv "PRIVMSG $qchan :$nick: $question"
puthelp "[exec rm $location]"
return 1
}

proc pub_Deny {nick host handle channel args} {
global ochan qchan
putserv "PRIVMSG $nick :Your message did not meet needed requirements. Thanks for your time"
return 1
}
Locked