Author Topic: Yawning Script  (Read 2921 times)

Oberst

  • Newbie
  • *
  • Posts: 6
Yawning Script
« on: July 17, 2008, 07:12:36 PM »
Ok, I have a simple script that when somebody yawns, I yawn myself. However, the script only triggers in the channel Im currently looking in, not the channel it was triggered in. Could somebody tell me what to add so the script fires in the right channel?

Code: [Select]
Sub ONACTION(Message,Channel,Nickname,Host,ServerNumber)
if instr(message,lcase("doesnt yawn")) or instr(message,lcase("doesn't yawn")) then
sendcommand "/timer yawn2 1 1 /me yawns anyways", servernumber
else if instr(message,lcase("yawn")) or instr(message,lcase("yawns")) then
sendcommand "/timer yawn 1 1 /me yawns", servernumber
end if
end if
End Sub

Script works fine as it is... just need to fix the channel.  :-)
Thanks in advance to anybody that can help.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Yawning Script
« Reply #1 on: July 18, 2008, 12:22:50 AM »
Just replace all references to m#mychannel, to your actual channel name.

Code: [Select]
Sub ONACTION(Message,Channel,Nickname,Host,ServerNumber)
if lcase(Channel) = "#mychannel" then
  if instr(lcase(message),"doesnt yawn") or instr(lcase(message),"doesn't yawn") then
    sendcommand "/timer yawn2 1 1 /describe #mychannel yawns anyways", servernumber
  else if instr(lcase(message),"yawn") then
    sendcommand "/timer yawn 1 1 /describe #mychannel yawns", servernumber
  end if
end if
End Sub
The IceChat God

Oberst

  • Newbie
  • *
  • Posts: 6
Re: Yawning Script
« Reply #2 on: July 18, 2008, 08:08:51 AM »
Thanks Snerf, I just took out your If statement and changed the action line to
Code: [Select]
sendcommand "/timer yawn 1 1 /describe "& Channel &" yawns", servernumber
I wanted the script to work on all channels, not just one given channel.
And I wasnt aware that /describe was a command, so thanks.  :lol:  That will defiantly help me later on.