Fortune teller Script V 1.0

By Weasel on May 03, 2009

Randomizes a fortune on the command #fortune
will be updated later,
to can customize it, change (1,9) if you want to (1,EnterANumber)
and add more fortunes!

on *:text:!fortune*:#: {
  /set %em $rand(1,9)
  if (%em == 1) { msg $chan $me looks into $nick 's future and sees Sadness in $nick 's day }
  if (%em == 2) { msg $chan $me looks into $nick 's future and sees Happyness in $nick 's day }
  if (%em == 3) { msg $chan An Unexpected Surprise waits in your day to come }
  if (%em == 4) { msg $chan An Unexpected Visit from a friend will arrive at your door today }
  if (%em == 5) { msg $chan You will have a good week }
  if (%em == 6) { msg $chan Somone close by needs your comfort }
  if (%em == 7) { msg $chan Patience is Nessecary in life }
  if (%em == 8) { msg $chan Friends are Nessecary in life, treat them kindly and good fortune will come to you }
  if (%em == 9) { msg $chan Comfort in life comes from Family, treat them with kindness and kindess will be recived }
}

Comments

Sign in to comment.
napa182   -  May 05, 2009

PATX Said

yeah he could do that. and if he did do that then there would be more options of your fortune which would be cool!

lol yeah but I don't think he would even know where to start on a socket code.

 Respond  
PATX   -  May 04, 2009

lol. me did not even know thos sites where on the web lol. but yeah he could do that. and if he did do that then there would be more options of your fortune which would be cool!

 Respond  
napa182   -  May 04, 2009

another way of doing this code is a socket. This is only an example! I know that Weasel would have no clue how to make a socket but il post this as a comment anyways. So again this is only a example:

on $*:text:/@fortune$/iS:#: { if (!%fortuneflood) { set -u3 %fortuneflood on | if ($sock(fortune)) .sockclose fortune | set %fortune.chan.nick $chan $nick | .sockopen fortune www.fortunecookiemessage.com 80 } }
on *:sockopen:fortune: { sockwrite -nt $sockname GET / HTTP/1.1 | sockwrite -nt $sockname Host: www.fortunecookiemessage.com | sockwrite -nt $sockname $crlf }
on *:sockread:fortune: {
  var %fortune | sockread %fortune
  if ($regex(%fortune,/(\w.+)<\/p>/)) { msg $gettok(%fortune.chan.nick,1,32) 14[04 $gettok(%fortune.chan.nick,2,32) Here Is Your Random Fortune 14] $regml(1) | unset %fortune.chan.nick | .sockclose fortune }
}
 Respond  
PATX   -  May 04, 2009

use if and else (read a tutorial)

 Respond  
Weasel   -  May 04, 2009

by the way, how do i make it when somone says !guess (word) if it's anything but the correct answer it says not correct, but when it is, it says correct

 Respond  
PATX   -  May 04, 2009

so basicly this snipt is:

  1. Ripped
  2. Old/Same code.
  3. The best one Weasel has ever done.

getting better....

 Respond  
Kirbeh_Pr0nz   -  May 04, 2009

Thats why snippet pages have a comments section MaxEvans :P But i must say, this snippet is by far the best one ive seen by Weasel. out of the what....10 posts?
Weasel, just remember instead of putting the variable as %em you can make it anything you want, like as MaxEvans did, %fortune

 Respond  
MaxEvans   -  May 04, 2009

I'd suggest try posting stuff to the forums for feedback, really. That way the snippets section doesn't get flooded with crappy simple scripts.

 Respond  
Kirbeh_Pr0nz   -  May 04, 2009

Well, i guess the only way to learn is to get feedback from other people. But Weasel, before you post, make sure its worth our time to give you feedback

 Respond  
MaxEvans   -  May 04, 2009

Wow, it's worse than I thought. Only difference is the content and command.

Though.. This is how I would write it. Even though this is a very simple script.

On *:Text:!fortune*:#: {
  var %fortune $rand(1,9)
  if (%fortune == 1) { .msg $chan $me looks into $nick $+ 's future and sees sadness in their day. }
  if (%fortune == 2) { .msg $chan $me looks into $nick $+ 's future and sees happiness in their day. }
  if (%fortune == 3) { .msg $chan An Unexpected Surprise waits in your day to come. }
  if (%fortune == 4) { .msg $chan An Unexpected Visit from a friend will arrive at your door today. }
  if (%fortune == 5) { .msg $chan You will have a good week. }
  if (%fortune == 6) { .msg $chan Somone close by needs your comfort. }
  if (%fortune == 7) { .msg $chan Patience is Nessecary in life. }
  if (%fortune == 8) { .msg $chan Friends are Nessecary in life, treat them kindly and good fortune will come to you. }
  if (%fortune == 9) { .msg $chan Comfort in life comes from Family, treat them with kindness and kindess will be recived. }
}

Not that it makes it any better. Just fixes the variable, and sets it as a local var, and I fixed the puncuation and added . before the msg to silence it. And reworded a couple of things.

 Respond  
Cheiron   -  May 04, 2009

same codes each time just different titles Max...

on *:text:!channels*:#: {
 /set %em $rand(1,9)
 if (%em == 1) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 2) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 3) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 4) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 5) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 6) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 7) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 8) { msg $chan you might want to try <EnterAChannelHere> }
 if (%em == 9) { msg $chan you might want to try <EnterAChannelHere> }
}

that was his channel dialogue

this was in his bunch of code...

on *:text:!random*:#:{
  /set %em $rand(1,8)
  if (%em == 1) { msg $chan i like pie }
  if (%em == 3) { msg $chan WHEEEEEEEEHOOOOOOOO! }
  if (%em == 4) { msg $chan WHEEEECALP }
  if (%em == 5) { msg $chan $me slaps $nick }
  if (%em == 6) { msg $chan i like gerbils }
  if (%em == 7) { msg $chan i like Cows }
  if (%em == 8) { msg $chan people scare me! }
}

there is no new coding here at all

 Respond  
Weasel   -  May 04, 2009

Max, i made this by myself :-<

 Respond  
napa182   -  May 03, 2009

like i said on one of ur other snippets
Weasel what would be best for you is to join a server that has a scripting room so you can learn and get help.

 Respond  
MaxEvans   -  May 03, 2009

I agree with napa.. especially since your other script has the same variable. It would clash. Speaking of which, use a different variable.

And why do I get the feeling this was something else, and you just edited it to make it? Am I the only one who wonders that?

 Respond  
napa182   -  May 03, 2009

no reason to set a global var just use a local, and as well this would work better as a socket imo.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.