!fortune script

By JONBO on Mar 29, 2004

This is just like a fortune cookie. (it gives you your fortune and some lucky numbers.) Just type !fortune to use. (only other people can use this (not you) in less they got this code )

; PLACE ALL IN REMOTES
; This is just like a fortune cookie (it gives you your fortune and lucky numbers)
; You can always add one by typing ( write fortune.txt (then what you want) )
; You can edit anything behind write fortune.txt
; (For privacy) You can take out ( /msg # $nick is looking at his fortune ) and it won't say in a room he is looking at his fortune 
; Only other people can use this (not you)
; Use by other people Typing ( !fortune )

on *:TEXT:!fortune:#: {
  /notice $nick $read fortune.txt
  /notice $nick Your lucky numbers are $rand(0,20),  $rand(10,50),  $rand(30,70), and  $rand(50,99).
  /msg # $nick is looking at his fortune.

  write fortune.txt Your words are going to bring peace to alot of people !
  write fortune.txt You will find it easy to stand up and accomplish your goals !
  write fortune.txt You will have to be brave and stand up !
  write fortune.txt One day you will be treated like a real man!
  write fortune.txt You will find new and easier ways in life!
  write fortune.txt You will have lots of Good luck in the future!
  write fortune.txt People love the way you are now don't change your looks or attidude!
  write fortune.txt Have fun look at the bright sides even if stuff go's wrong!
  write fortune.txt Your destin is to become a rich man!
  write fortune.txt Life will become faster and faster as you get older, Have as much fun as you can now!
  write fortune.txt Your fortune is not to good if you make the wrong choices, so make a wise and smart decision!
  write fortune.txt Your fortune is bright you luck will help you in many ways!
  write fortune.txt Life is not always fair but try to get the best out of it!
  write fortune.txt Have as much fun as you can now, cause it will get harder when you get older!
  write fortune.txt Spend time with people, cause you might not see them tomorrow!
  write fortune.txt You are always being test, Make a 100!
}

Comments

Sign in to comment.
Jethro   -  Oct 03, 2009

That's awesome, slacker. Thank you for your time and example.

 Respond  
slacker   -  Oct 02, 2009

or maybe go with a socket for the hell of it

on $*:text:/@fortune$/iS:#: { if (!%fortuneflood) { set -u3 %fortuneflood on | if ($sock(fortune)) .sockclose fortune | .sockopen fortune www.fortunecookiemessage.com 80 | .sockmark fortune # $chr(91) $nick Here Is Your Random Fortune $chr(93) } }
on *:SOCKOPEN:fortune: { sockwrite -nt $sockname GET / HTTP/1.1 | sockwrite -nt $sockname Host: $+(www.fortunecookiemessage.com,$str($crlf,2)) }
on *:SOCKREAD:fortune: {
  var %fortune | sockread %fortune
  if ($regex(%fortune,/([A-z].+)<\/p>/)) { msg $sock(fortune).mark $regml(1) :Lucky Numbers: $+($r(0,20),$chr(32),$r(10,50),$chr(32),$r(30,70),$chr(32),and,$chr(32),$r(50,99).) | .sockclose fortune }
}
 Respond  
Jethro   -  Oct 02, 2009

or just $read(fortune.txt)

 Respond  
FARTBAG   -  Oct 02, 2009

It would be a lot easier to use /play with the -r flag

 Respond  
Ghost-writer   -  Jul 25, 2009

but i copied script and its a good accessory for my bot :)

 Respond  
Grant-   -  Jul 25, 2009
on $*:TEXT:/^[@.!]fortune$/Si:#:{
  notice $nick $read(fortune.txt)
  notice $nick Your lucky numbers are $rand(0,20) $+ , $rand(10,50) $+ , $rand(30,70) $+ , and $rand(50,99).
  describe # $nick is looking at his fortune.
  write fortune.txt Your words are going to bring peace to alot of people !
  write fortune.txt You will find it easy to stand up and accomplish your goals !
  write fortune.txt You will have to be brave and stand up !
  write fortune.txt One day you will be treated like a real man!
  write fortune.txt You will find new and easier ways in life!
  write fortune.txt You will have lots of Good luck in the future!
  write fortune.txt People love the way you are now don't change your looks or attidude!
  write fortune.txt Have fun look at the bright sides even if stuff go's wrong!
  write fortune.txt Your destin is to become a rich man!
  write fortune.txt Life will become faster and faster as you get older, Have as much fun as you can now!
  write fortune.txt Your fortune is not to good if you make the wrong choices, so make a wise and smart decision!
  write fortune.txt Your fortune is bright you luck will help you in many ways!
  write fortune.txt Life is not always fair but try to get the best out of it!
  write fortune.txt Have as much fun as you can now, cause it will get harder when you get older!
  write fortune.txt Spend time with people, cause you might not see them tomorrow!
  write fortune.txt You are always being test, Make a 100!
}
 Respond  
Ghost-writer   -  Jul 25, 2009

when i read in less i knew you were a bad scripter lol

 Respond  
[-Superboyz-]   -  Aug 26, 2004

/notice: insufficient parameters (line 10, script8.ini) <-- please ...

 Respond  
eduExodus   -  Aug 09, 2004

I like it! Of course, I removed the write commands and simply instructed the script to $read fortune.txt. I also corrected some spelling mistakes. It\'s great for a ChanBot though! Thanks for the idea, JONBO!

 Respond  
SaltyFrie   -  Apr 28, 2004

Lol. JONBo, you could do that, or create a .txt file like sailoreagle said. The script would go something like: on :TEXT:!fortunecookie:#:/timer 1 1 /msg $chan The Fortune Says: $!read(cookie.txt)

 Respond  
sailoreagle   -  Mar 30, 2004

Bracket mismatch - you\'re missing a closing } - you should always doublecheck and close ALL the brackets you\'re using, otherwise the script is likely to mess up. Also, I can\'t fathom why you\'ve stuck write commands in there... that\'ll eventually make the text file HUGE, since every time somebody does !fortune the script writes all those lines to txt file. Why not just instruct people to make a file named fortune.txt in their mIRC directory? Also: I know it works anyway, but try and use $read properly (it\'s $read(filename.txt), not $read filename.txt).

 Respond  
JONBO   -  Mar 29, 2004

This script is cool

 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.