Author Topic: waving script  (Read 3425 times)

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
waving script
« on: January 24, 2006, 04:03:28 AM »
Ok, most of you will probably find this script very useless oslt.
but I made a waving script that only says "\o" when someone says "\o" or "o/"

the problem is that it's being abused :D

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                                       
Dim "waver"                           
  elseif (Message= "\o" or Message = "o/") and Nickname <> waver then               
    Sendcommand "/msg " + Channel + " \o ", Servernumber                   
  Waver = Nickname
  end if                     
End Sub

I tried something like that but it won't work (that's supposed to reply only if the last wave message was by the same person)

Also, how could I make it reply if the first word (or any word) of a message is "\o" or"o/"?
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1972
    • IceChat IRC Client
Re: waving script
« Reply #1 on: January 24, 2006, 08:59:09 AM »
Hello

Well, you were close, but not quite right, you have some of the syntax incorrect. It would be more like this.

Code: [Select]
Dim LastWaver
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                                       
  if ( Instr(Message,"\o") or Instr(Message,"o/") ) and Nickname <> LastWaver then               
    Sendcommand "/msg " + Channel + " \o", Servernumber                   
    LastWaver = Nickname
  end if                     
End Sub

The LastWaver variable has to be declared outside of the Sub, for it to be remembered, otherwise it would just get reset each time the sub is run.

The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: waving script
« Reply #2 on: January 24, 2006, 09:59:31 AM »
thanks a  lot once again

I guess the instr command searches lines for specific words or characters
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein