mIRC Homepage
Posted By: CyborAccess vote script and fortune cookie script - 19/01/05 04:04 AM
hi,can anyone teach me how to make a vote script?
like after everyone voted,it review,how much vote is voted on that 1 and this ,can anyone tell me?


and...

and anyone tell me how to make a fortune cookie script?
like if u say !cookie,if randomly pick a message from the script setup and appear it on the channel,any idea?
for the fortune cookie script try looking in help under $read
thats /help $read
should do the trick
your other idea is a bit more difficult so ill leave that to the pros wink
i dont get it,...can u tell me how to work it?
Posted By: clutz1572 Re: vote script and fortune cookie script - 19/01/05 05:25 AM
Cybor,

try searching these sites :
mircscripts.org
hawkee.com
mircscripts.com
mirc.net

there tons of already to go scripts and snippets on these sites, i know there are quite a few voting scripts out there..... fortune cookie scripts...??? dunno

hope this helps
fortune cookies are easy you just
make a txt full of all the random crap you want then use $read to msg it on a text event
Posted By: DaveC Re: vote script and fortune cookie script - 19/01/05 08:03 AM
Quote:
and anyone tell me how to make a fortune cookie script?
like if u say !cookie,if randomly pick a message from the script setup and appear it on the channel,any idea?


Code:
on *:TEXT:!cookie:#yourchannelnamehere:{ msg $chan $read(cookies.txt) $+ . }


note: the $+ . is incase the line in the cookies.txt file is blank

Put a cookie text on each line of the cookies.txt file, ie......
You well have a good day today
You well be lucky today
Tomorrow well be rainy


note: the lines may include identifiers to be evaluated at the time ie..

You well have a good day today
You well find happy times ahead $nick $+ , just keep in this channel smile
You well be lucky today
Tomorrow well be rainy



A slightly better bot is this
Code:
on *:TEXT:!cookie:#yourchannelnamehere:{
  if (%djc.cookie.pause != $true) {
    set -u1 %djc.cookie.pause $true
    msg $chan $read(cookies.txt) $+ .
  }
}

It simply makes the bot only reply once per second, so i cant get flooded by people doing !cookie

All above text (c) Copyright DaveC 2005, no part maybe reproduced without my express writtin permission.

PS: I give that permission <snicker snicker>
This is a small thing, though you could use a double $ for that read, so that the code isn't executed when nothing is returned, makes the dot thing obsolete.
Posted By: DaveC Re: vote script and fortune cookie script - 20/01/05 12:12 AM
Quote:
This is a small thing, though you could use a double $ for that read, so that the code isn't executed when nothing is returned, makes the dot thing obsolete.


But then you wouldnt be able to annoy people by just saying . in channel smile

No actually your quite right, i dont use $$ much i dont like the way it just kills a script dead, i would also need to make it like this, since shutting the bot down for 1 sec without saying anythings a bit clumsy
Code:
on *:TEXT:!cookie:#yourchannelnamehere:{
  if (%djc.cookie.pause != $true) {
    msg $chan $$read(cookies.txt)
    set -u1 %djc.cookie.pause $true
  }
}
Hmm I suppose you wanted to put the double $$ in the $read rather than the $chan? Since the on text is triggered on a channel in this case, it will always be filled.

Cya
Posted By: DaveC Re: vote script and fortune cookie script - 20/01/05 12:55 AM
What? what? I dont know what you mean, it appears to be on the $read now doesnt it?

<snicker snicker>

/me goes back and clicks the EDIT link again

Yep I just wasnt paying attention and just added it to the first $ i saw.
i used
on *:TEXT:!cookie:#yourchannelnamehere:{ msg $chan $read(cookies.txt) $+ . }

and for reason,it keep repeating the DOT cuz of the "DOT" in the "$+ . }" part,so is there anyother way to write this script? confused
Posted By: DaveC Re: vote script and fortune cookie script - 21/01/05 04:41 AM
on *:TEXT:!cookie:#yourchannelnamehere:{ msg $chan $$read(cookies.txt) }
ok thanks
hi,this is how i setup my cookie.txt:


4fortune:3u found a doller on the floor.
}
4fortune:3your homework was ate by ur dog.
}
4fortune:3u got a bad cold cuz u play all day in the rain
}
4fortune:3ur worst nightmare has just begun...
}
4fortune:3u gave two doller to a home-less
}
4fortune:3u found a other fortune cookie on the floor
}
4fortune:3tomorrow will be raining
}

is this how i set it up? c uz sometimes i say !cookie,it wont work,and sometimes it works?
u no how 2 setup the ccokie.txt? confused
Posted By: DaveC Re: vote script and fortune cookie script - 21/01/05 06:11 AM
4fortune:3u found a doller on the floor.
4fortune:3your homework was ate by ur dog.
4fortune:3u got a bad cold cuz u play all day in the rain
4fortune:3ur worst nightmare has just begun...
4fortune:3u gave two doller to a home-less
4fortune:3u found a other fortune cookie on the floor
4fortune:3tomorrow will be raining
4fortune:3tomorrow will be raining

no funny lines with } on, ok!
The reason it didn't work, is because $read without n flag evaluates it's read-in contents.

If you do $read(cookie.txt,n) it would work, but since there's no reason at all to put those } in the first place, what DaveC gave you, is what you are looking for.

Greets
© mIRC Discussion Forums