8ball

By DeathGod87 on Dec 29, 2008

Err...my 3rd post and 3rd script ^-^ Enjoy

on *:TEXT:!8ball*:#:{
  set %8ball $rand(1,10) 
  if (%8ball == 1) msg $chan 10No! 
  if (%8ball == 2) msg $chan 10Yes 
  if (%8ball == 3) msg $chan 10Maybe 
  if (%8ball == 4) msg $chan 10Of course 
  if (%8ball == 5) msg $chan 10Are you crazy?!?! 
  if (%8ball == 6) msg $chan 10How should I know? 
  if (%8ball == 7) msg $chan 10What are you smoking?
  if (%8ball == 8) msg $chan 10No way in hell!
  if (%8ball == 9) msg $chan 10Only on the weekends
  if (%8ball == 10) msg $chan 10Hahahaha, you make me laugh!
}

Comments

Sign in to comment.
`Green   -  Dec 30, 2008

not that bad for just starting but you do need to learn scripting better. go and look at a tutorial and you should be able to find what you need. if not then you can ask people for some help. most people will help you just so you don't post crap snippets lol. i can help for a lot of stuff.

 Respond  
DeathGod87   -  Dec 30, 2008

Ohh...Of thax

 Respond  
slacker   -  Dec 30, 2008

well only showing you better coding habbits.

 Respond  
PuNkTuReD   -  Dec 30, 2008

adding the ! before the identifier
is the same as checking
$2 == $null

!$2 means $2 does not exist, returns $null

 Respond  
Aucun50   -  Dec 30, 2008

Idk what all the !,@ are about, it makes more scene to me my way.

 Respond  
slacker   -  Dec 30, 2008

@Aucun50 you dont need to do

if ($2- == $null) {

this will work the same.

if (!$2) {

cuz if there is no 2 then there is no 3 and so on.

 Respond  
Aucun50   -  Dec 30, 2008

Do you mean this `green?

on :TEXT:!8ball:#:{
if ($2- == $null) {
msg $chan No Question was Entered!
}
else {
set %8ball $rand(1,10)
if (%8ball == 1) msg $chan 10No!
if (%8ball == 2) msg $chan 10Yes
if (%8ball == 3) msg $chan 10Maybe
if (%8ball == 4) msg $chan 10Of course
if (%8ball == 5) msg $chan 10Are you crazy?!?!
if (%8ball == 6) msg $chan 10How should I know?
if (%8ball == 7) msg $chan 10What are you smoking?
if (%8ball == 8) msg $chan 10No way in hell!
if (%8ball == 9) msg $chan 10Only on the weekends
if (%8ball == 10) msg $chan 10Hahahaha, you make me laugh!
}
}

 Respond  
slacker   -  Dec 30, 2008

heh probly so.

`Green wrote:
maybe add an if that will say "No Question Was Entered!" if nobody adds a question after !8Ball.

to do the if $2 was not said you can change the line

msg # 10 $gettok(%@,$r(1,10),124)

to this in my edited version of it.

msg # $iif(!$2,4Sorry No Question Was Entered!,10 $gettok(%@,$r(1,10),124))
 Respond  
`Green   -  Dec 30, 2008

well it works i will give you that. but it is a little long for just an 8ball snippet like this. i'd go with slackers.or maybe add an if that will say "No Question Was Entered!" if nobody adds a question after !8Ball.

 Respond  
slacker   -  Dec 29, 2008

you should use local vars instead of global and add a flood pro to it as well.

on *:TEXT:!8ball *:#:{
  if (!$($+(%,8ballflood),2)) {
    set -u4 $+(%,8ballflood) on
    var %@ = No!|Yes|Maybe|Of course|Are you crazy?!?!|How should I know?|What are you smoking?|No way in hell!|Only on the weekends|Hahahaha, you make me laugh! 
    msg # 10 $gettok(%@,$r(1,10),124) 
  }
}
 Respond  
DeathGod87   -  Dec 29, 2008

Wow...Thax ^-^ I made em at my friends house....My friend was teaching me how to make codes when I decided to try it ^-^. Thax for comenting anywayz

 Respond  
Aucun50   -  Dec 29, 2008

Lol
<@Aucun50> !8ball hello
<@Aucun|B> Hahahaha, you make me laugh!

Work great, good job.

 Respond  
DeathGod87   -  Dec 29, 2008

Post/Comment/Rate Enjoy. 3rd post and script i think :[

 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.