IceChat Forums

IceChat 7 => IceChat 7 Scripts => Topic started by: Windows_95 on September 15, 2008, 12:12:13 AM

Title: out text 8 ball
Post by: Windows_95 on September 15, 2008, 12:12:13 AM
Code: [Select]
Function OUTTEXT(OutgoingText)
SendCommand OutGoingText
channel = getidentifier("$channel")
ServerNumber = GetIdentifier("$currentservernumber")
if len(outgoingtext) > 7 then
  if left(outgoingtext,6) = "!8ball" then
    Play8Ball Channel,Mid(outgoingtext,8),ServerNumber
  end if
end if
OUTEXT = OutgoingText
End Function

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
if len(message) > 7 then
  if left(Message,6) = "!8ball" then
    Play8Ball Channel,Mid(Message,8),ServerNumber
  end if
end if
End sub

Sub Play8Ball(chan,MsgTxt,ServerNumber)
Dim num                    

Ball_reg = Array("Absolutely yes!","Answer hazy.","Prospect looks bleak.","No.","That's a question you should ask yourself.","Prospect looks hopeful.","I like to think so.","Not even on a GOOD day.","It would take a disturbed person to even ask.","Maybe -- give me more money and ask again.","Yes, yes, yes, and yes again.","You wish.","Not bloody likely.","I'm busy.","Concentrate and ask again.","Most likely.","I wouldn't know anything about that.","No way.","All signs point to yes.","Never.","Yes.","Maybe.","Sometime in the near future. Ask again tomorrow.","Over my dead body.","That question is better remained unanswered.","We won't go there")
Ball_howshould = array("Very carefully.","Alone.","With a can opener","Using a pencil sharpener","As quickly as possible","Slowly and carefully.","With a friend.","With someone you love.","Just don't do it.","Just do it.","Not alone.","With help.","With a screwdriver.","With a spoon.","With a fork.","With a knive.","Using a toaster.","In the woods.","Under the bed.","In bed.","In the kitchen.","In the living room.","In the back seat of the car.","At McDonald's.","I wouldn't know how to do that. I'm not the person you should be asking. :)","Don't ask me.","Beats me.","In plain view.","Freely.","With a large audience.","With a small audience.")

Ball_howis = array("Just fine","Not doing too well.","I don't know","I have no idea","Don't ask","Good","Bad")

Ball_when = array("Tomorrow at 6:00pm","In an hour","In ten minutes","In less than 2 hours","It won't happen unless you act now","In three days","Today","Now","Tonight","In 1997 sometime","Three days before the second full moon after your next birthday","Next week","In the next year","Never","Tomorrow afternoon","Next month","In January","In February","In March","In April","In May","In June","In July","In August","In September","In October","In November","In December","Summertime","Wintertime","Springtime","Autumn")

Ball_where = array("In bed.","Outside.","Inside.","In Minnesota.","In New York.","In Seattle.","In Sydney, Australia.","Next to your best friend.","Beside your worst enemy.","At home.","At work.","At a bowling alley.","At a golf course.","At a sports arena.","Under the bed.","In the street.","In your friend's car.","In the back seat of a car.","In a doorway.","At your computer terminal.","In a chair.","At the dinner table.","In the refrigerator.","At your friend's house.","Sitting on the lap of someone you love.","On your great-great-great-great grandfather's grave.","At Disneyworld.","At McDonald's.","In the restroom.","In the bathtub.","In the shower.","Behind closed doors.")


num = Int((Ubound(Ball_Reg) * Rnd) + 0)
ball = Ball_Reg(num)

if instr(lcase(MsgTxt),"time") or instr(lcase(MsgTxt),"date") then
     SendCommand "//msg " & chan & " the 8 ball says..." & chr(34) & "It is $time on $date " & chr(34),ServerNumber
     exit sub
end if

if instr(lcase(MsgTxt),"ould") or instr(lcase(MsgTxt),"will") or instr(lcase(MsgTxt)," do") or instr(lcase(MsgTxt)," are ") or instr(1,lcase(MsgTxt)," am ") or instr(1,lcase(MsgTxt)," go") or instr(1,lcase(MsgTxt)," to ") then
     if instr(lcase(MsgTxt),"how") then
          num = Int((ubound(Ball_howshould) * Rnd) + 0)
          ball = ball_howshould(num)
     end if
end if

if instr(lcase(MsgTxt)," was ") or instr(lcase(MsgTxt)," is ") or instr(lcase(MsgTxt)," were ") then
     if instr(lcase(MsgTxt),"how") then
          num = Int((ubound(Ball_howis) * Rnd) + 0)
          ball = ball_howis(num)
     end if
end if

if instr(lcase(MsgTxt),"when") then
     num = Int((ubound(Ball_when) * Rnd) + 0)
     ball = ball_when(num)
end if

if instr(lcase(MsgTxt),"where") then
     num = Int((ubound(Ball_where) * Rnd) + 0)
     ball = ball_where(num)
end if

if instr(lcase(MsgTxt)," old") or instr(lcase(MsgTxt)," age") then
     SendCommand "/msg " & chan & " the 8 ball says..." & chr(34) & Int((60 * Rnd) + 0) & " years." & chr(34),ServerNumber
     exit sub
end if

if instr(lcase(MsgTxt)," or ") then
     SendCommand "/msg " & chan & " the 8 ball says..." & chr(34) & "Dont ask me multiple choice questions." & chr(34),ServerNumber
     exit sub
end if

SendCommand "/msg " & chan & " the 8 ball says..." & chr(34) & Ball & chr(34),ServerNumber

End sub

i just made it work when u say !8ball as well as when someone else says it :-o

just save it as .ice