mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
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?


practice makes perfect... smile
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
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


The Kodokan will move you, one way or another.
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
i dont get it,...can u tell me how to work it?

Last edited by CyborAccess; 19/01/05 04:43 AM.

practice makes perfect... smile
Joined: Aug 2004
Posts: 423
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
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

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
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


The Kodokan will move you, one way or another.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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>

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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
  }
}

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
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


practice makes perfect... smile
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
on *:TEXT:!cookie:#yourchannelnamehere:{ msg $chan $$read(cookies.txt) }

Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
ok thanks


practice makes perfect... smile
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
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


practice makes perfect... smile
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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!

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.

Link Copied to Clipboard