Author Topic: onACTION - variables  (Read 2271 times)

LilScab

  • Newbie
  • *
  • Posts: 10
onACTION - variables
« on: February 29, 2008, 09:41:28 PM »
I am currently working on a basic onACTION script that replies to the particular user.

My question is, how can i change the script so if someone like an OP or admin/owner uses it, it will reply differently?

the part i am working on for this is as follows.
Code: [Select]
Sub ONACTION(Message,Channel,Nickname,Host,ServerNumber)
     if instr(lcase(Message),"golden button") then
       SendCommand "/describe " & Channel & " zips " & NickName & "'s mouth shut in silence",ServerNumber
     elseif instr(lcase(Message),"gold button") then
       SendCommand "/describe " & Channel & " zips " & NickName & "'s mouth shut in silence",ServerNumber
     elseif instr(lcase(Message),"yellow button") then
       SendCommand "/describe " & Channel & " sends " & NickName & "'s phone number to all the telemarketers so they can call all day and all night",ServerNumber
     end if
End Sub

What i need is if OP or admin uses the gold button action for the bot to be able to moderate the channel as well as a different reply
       SendCommand "/describe " & Channel & " zips " & NickName & "'s mouth shut in silence",ServerNumber

Instead of showing nickname, i'd like it to show channelname as well.
so it'd be like "unplugs the keyboard of all users in <insert channel name here>" as well as moderating the channel.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: onACTION - variables
« Reply #1 on: March 01, 2008, 12:16:47 AM »
Code: [Select]
'this will check if the nick is an operator on the channel
If ISOP(Nickname,Channel,ServerNumber) = True then

End If

And to display the channel, just use the 'Channel' variable like you have used the 'Nickname' variable in your own code
"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

LilScab

  • Newbie
  • *
  • Posts: 10
Re: onACTION - variables
« Reply #2 on: March 01, 2008, 05:37:19 AM »
after a little effort and some confusion on my part... like missing a space here or a " there... it seems to be working fine now,
thanks for the assistance