Author Topic: requesting help with script  (Read 4533 times)

quackstar

  • Newbie
  • *
  • Posts: 3
requesting help with script
« on: August 18, 2007, 09:06:18 AM »
ok, i was wanting to set up a script to disconnect when i type something in, after i've turned the script on. i would like to set it by doing something like !set-bomb or/set-bomb so it dosn't show to everybody. then it should  msg you saying that its set. i got stuck here:
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
if lcase(Message) = "!set-bomb" then
SendCommand "//msg Xana20Randomized Bomb Set"
bomb = "On"
end If

if bomb = "On" then
if lcase(Message) = * then
SendCommand "//clear"
SendCommand "/echo Quackstar Bomb Initiated"
SendCommand "/echo Cache Cleared"
SendCommand "//quit Protection: Prevents flooding by brother"
end If
end If
end Sub
The whole point of this is to disconnect my brother when he types something in because last time he flooded the channel and harrassed others, getting me banned for a month.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: requesting help with script
« Reply #1 on: August 18, 2007, 09:29:42 AM »
Well, if you want it to work for !set-bomb, everyone in the channel will see that message, so there is no way around that.
What you will probably want is a notice, or a query msg instead, to him. So you would use ON NOTICE or ON QUERY for that.

One problem I see with your script, is this line.

Code: [Select]
if lcase(Message) = * then

That should be
Code: [Select]
if lcase(Message) = "*" then

And if you want it to remember the value of bomb, you need to declare the value outside of the sub.

Like this

Code: [Select]
Dim bomb

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber).
.
.
.

Also, at the end of your SendCommand's, you should add ,ServerNumber at the end, in case you run multiple server connections..
eg.

Code: [Select]
SendCommand "/msg Xana20Randomized Bomb Set", ServerNumber

And last, you dont need // in front of all your commands, just a single / will do.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: requesting help with script
« Reply #2 on: August 18, 2007, 10:15:22 AM »
couldn't you just load a script like this when you leave the computer?
Code: [Select]
Function OUTTEXT(OutgoingText)

End Function

this will cause that nothing you type will get posted until you remove the script
"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: 1968
    • IceChat IRC Client
Re: requesting help with script
« Reply #3 on: August 18, 2007, 11:18:49 AM »
Ah, if he types something, thats right. That would cause the client to not work, until you removed that script.
That would be a great way to stop others from using it.
The IceChat God

quackstar

  • Newbie
  • *
  • Posts: 3
Re: requesting help with script
« Reply #4 on: August 18, 2007, 12:35:11 PM »
couldn't you just load a script like this when you leave the computer?
Code: [Select]
Function OUTTEXT(OutgoingText)

End Function

this will cause that nothing you type will get posted until you remove the script

thanks, that really helps! short and simple. there is though one thing that i would like to do. i would like it to quit when that happens because you can still paste stuff, and the chatroom that i like says alot of bad stuff and thats not good. i know i'm sounding picky, i'm a VB noob, hence why i couldn't do this. why won't this work:

Code: [Select]
Function OUTTEXT(OutgoingText)
SendCommand "/part Anti-Brother Bot Initiated", ServerNumber
End Function

thanks!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: requesting help with script
« Reply #5 on: August 18, 2007, 03:22:44 PM »
Function OUTTEXT(OutgoingText)
SendCommand "/part"
End Function
The IceChat God