Author Topic: Please Help  (Read 5642 times)

udhelp

  • Guest
Please Help
« on: July 22, 2006, 04:55:56 AM »
Im trying to create a script that will pull up a quote. like when <user>!quote . Ive went through the help file built in over and over, and still dont get out to do it. Ive searched the website, the forums, wikipedia, ect, and still cant find anything on it. If someone can tell me how, or give me a link to where i can find a guide to it, it would be greatly apreciated. thanks.

~UDHelp

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Please Help
« Reply #1 on: July 22, 2006, 08:59:01 AM »
Here is a start for you, to get ya going.

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
'this subroutine fires any time there is a channel message

if Message = "!quote" then
     'do something here
end if

End Sub
The IceChat God

udhelp

  • Guest
Re: Please Help
« Reply #2 on: July 22, 2006, 07:19:11 PM »
Thanks, one more question, what is the command to make certain text apear in the channel (to evreyone)? after calling it with that "!quote"? thanks for the help so far.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Please Help
« Reply #3 on: July 23, 2006, 12:32:56 AM »
SendCommand "/msg " + Channel + " and your quote is.. blah blah", ServerNumber
The IceChat God

udhelp

  • Guest
Re: Please Help
« Reply #4 on: July 23, 2006, 01:02:09 AM »
how would you get the serve number? im using Loopy.VillageIRC.net but i cant find anywhere that says the number.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Please Help
« Reply #5 on: July 23, 2006, 01:37:14 AM »
oyu don't need a specific number, just type 'servernumber' without the quotes
"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

udhelp

  • Guest
Re: Please Help
« Reply #6 on: July 23, 2006, 01:41:36 AM »
wow, thakns alot, i got it now.

udhelp

  • Guest
Re: Please Help
« Reply #7 on: July 23, 2006, 01:53:22 AM »
okay, i think this is my last question. i put the bot in 2 rooms to see what would happen. is there a way to set itso that if someone says !quote in channelA, it responds only in channelA. Same with ChannelB.

I thought this would work but it doesnt.

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber) 
'this subroutine fires any time there is a channel message 

if Message = "!quote" then 
     SendCommand "/msg $chan testing123", ServerNumber
end if 


Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Please Help
« Reply #8 on: July 23, 2006, 09:12:18 AM »
Ok, now you changed the script, it will not work properly the way you have it. $chan is parsed out as the current channel you are in, that will give you undesired effects, especially if you are not in a channel.

You could use an "if" statement for each different channel you are in. Also, the channel name is case sensative, so "#SomeChannel" is different from "#somechannel" so make sure its typed properly.

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber) 
'this subroutine fires any time there is a channel message 

if Message = "!quote" and Channel ="#somechannel" then 
     SendCommand "/msg " & Channel & " testing123", ServerNumber
end if 

Quote
The IceChat God