ok this script is for yes or no questions only. this is my first snippet so plz tell me how well i did.
on *:TEXT:Ystartquiz*:#:{
if ($me == Yoshi && $nick !isop #) { notice $nick Only Draven can use this command!
}
if ($me == Yoshi && $nick isop # && %quizq != $null) { notice $nick there is already a poll in progress
}
if ($me == Yoshi && $nick isop # && %quizq == $null && $2- == $null) { notice $nick Please use the correct syntax, as in Ystartquiz <question>
}
if ($me == Yoshi && $nick isop # && %pollq == $null && $2- != $null) {
msg $chan 3 A quiz has started for: $2-
msg $chan Use Yguessyes for yes or Yguessno for no, you may only vote once
set %quizq $2-
set %quizy 0
set %quizn 0 }
}
on *:TEXT:Yguessyes*:#:{
if ($me == Yoshi && %quizq == $null) { notice $nick There is no quiz going on at this time
}
if ($me == Yoshi && %quizq != $null && $address isin %voter) { notice $nick you have already voted in this poll
}
if ($me == Yoshi && $address !isin %voter) {
notice $nick Thank you for the vote of yes! Please participate in the next quiz
inc %quizy
/set %voter $addtok(%voter,$address,32) }
}
on *:TEXT:Yguessno*:#:{
if ($me == Yoshi && %quizq == $null) { notice $nick There is no quiz going on at this time
}
if ($me == Yoshi && %quizq != $null && $address isin %voter) { notice $nick you have already voted in this quiz
}
if ($me == Yoshi && $address !isin %voter) {
notice $nick Thank you for the vote of no! Please participate in the next quiz
inc %quizn
/set %voter $addtok(%voter,$address,32) }
}
on *:TEXT:Yquiz*:#:{
if ($me == Yoshi && %quizq == $null) { notice $nick there is no poll in progress at this time
}
if ($me == Yoshi && %quizq != $null) {
notice $nick The current poll question is; %quizq
notice $nick Use !voteyes for yes or !voteno for no, you may only vote once }
}
on *:TEXT:Yquizresults*:#:{
if ($me == Yoshi && $address !isin %voter) { notice $nick you need to vote before seeing the results
}
if ($me == Yoshi && $address isin %voter) {
notice $nick for the Poll; %poll the votes stand at;
notice $nick Yes: %quizy
notice $nick No: %quizn
}
on *:TEXT:Yendquiz*:#:{
if ($me == Yoshi && $nick !isop #) { notice $nick Only Draven can use this command!
}
if ($me == Yoshi && %quizq == $null) { notice $nick There is no poll to end at this time
}
if ($me == Yoshi && $nick isop # && %quizq != $null) {
msg $chan 1 The Poll has now ended for the question: %quizq ; and the results are;
msg $chan 3 Yes: %quizy
msg $chan 3 No: %quizn
}
if ($me == Yoshi && %quizq != $null && %quizy < %quizn) {
msg $chan 3 The Winning Answer is No with %quizn point(s)
}
if ($me == Yoshi && %quizq != $null && %quizn < %quizy) {
msg $chan 3 The Winning Answer is Yes with %quizy point(s)
}
if ($me == Yoshi && %quizq != $null && %quizy == %quizn) {
msg $chan 3 We have a Tie, Draven will now decide the answer!
}
unset %quizy
unset %quizn
unset %quizq
unset %voter
}
}
I don't know if this is deemed ripping or not, but I learned the basics by tweaking other ppls scripts and just seeing what they did & how they could be manipulated. Eventually I tried my own basic scripts and went from there. I still quite often have to ask for help or advice since the concept of scripting or computer language is very new to me and I sometimes need a little help to get me thinking in the right way.
lol I still remember the first guy that introduced me to mIRC. He showed me how to add a popup in the channel window (it was Hop:hop). I was so excited and was hooked after that!!!
Things like:
if ($me == Yoshi && $nick !isop #) { notice $nick Only Draven can use this command!
shouldn't be used in scripts you make public. Also using hard coded #channels in code is sloppy as well (not that you have done this, but in general).
Slacker has given great advice with his !%quizq and %quizq suggestion. And using things like unset %vote.* will make your scripts cleaner and look better. If you don't understand what he's referring to, from the mIRC help file:
/unset [-s] <%var>
This unsets and removes the specified variables from the variables list. If you specify a variable with wildcard characters then all matching variables will be removed.
/unset %test*
This will remove all variables beginning with the word %test.
instead of useing %quizq != $null or %quizq == $null you could do !%quizq an %quizq
also on ur unset of vars you can do unset %quizy %quizn %quizq %voter or beter yet why not name the vars like %vote.quizy %vote.quizn %vote.quizq and %vote.vote then unset them like unset %vote.*
you do have alot of redundancy in the script but good work on ur first script.