Author Topic: [Request] Variable Autoresponse Code  (Read 7031 times)

-.-**

  • Newbie
  • *
  • Posts: 2
[Request] Variable Autoresponse Code
« on: October 17, 2008, 09:23:16 PM »
Ok, when im using an Auto Response script and for some reason i might piss someone off, he can EASILY get me banned from a room by spamming my auto response trigger word then i get banned for repeating.


Anyone know codes for a Variable script that will put a time delay on my auto response? like 30 - 45 seconds?


Thanks much!

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: [Request] Variable Autoresponse Code
« Reply #1 on: October 17, 2008, 11:31:29 PM »
You could run a simple timer on your autoresponse script... using the command:

Code: [Select]
//timer $randtimer 1 30 //msg $chan YOUR_TEXT_HERE

This would delay it 30 seconds... if you are using the VBS style script... you can use this script:

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
rand_timer_id = getidentifier("$randimer",servernumber)
  if lcase(message) = "your text here" then
    sendcommand "//timer " & rand_timer_id & " 1 30 //msg " & channel & " YOUR_TEXT_HERE",servernumber
  End If
End Sub

I hope this helps in some way!

Thanks,

~Sam
~ Sam
~ Visit my website at http://www.TheCellist42.com

-.-**

  • Newbie
  • *
  • Posts: 2
Re: [Request] Variable Autoresponse Code
« Reply #2 on: October 18, 2008, 04:13:59 AM »
Sweet thx!

Im new to this though.... so how would i incorporate that into this

Code: [Select]
on *:TEXT:!hello:#icechat:{
/say $chan Hello $nick , how are you
/say $chan Welcome to $chan
}
?

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: [Request] Variable Autoresponse Code
« Reply #3 on: October 18, 2008, 07:29:25 AM »
Well... it would be easier to use what you're using now, to be honest. You can use the above code... if you edit the message you want it to trigger on, edit the text to say, and save it as a .ice file. As for the other script, to incorporate the timer in, you would use this:

Code: [Select]
on *:TEXT:!hello:#icechat:{
  //timer $randtimer 1 30 //msg $chan Hello $nick , how are you
  //timer $randtimer 1 35 //msg $chan Welcome to $chan
}

The above should suffice. Also, may I recommend NOT using /say $chan, because that would just print the channel to the active window, along with the other text. Use //msg $chan. :)

Hope this helps in some way!

Thanks,

~Sam
~ Sam
~ Visit my website at http://www.TheCellist42.com

juozas

  • Newbie
  • *
  • Posts: 13
Re: [Request] Variable Autoresponse Code
« Reply #4 on: October 19, 2008, 10:40:51 AM »
You may use random timer time instead of constant time so it may go more various

Code: [Select]
/timer $randtimer 1 $rand(30,60) //msg $chan sometext
As seen script does text output to a channel after a random time (between 30 and 60 secs).
« Last Edit: October 19, 2008, 10:42:23 AM by juozas »

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: [Request] Variable Autoresponse Code
« Reply #5 on: October 19, 2008, 10:42:16 PM »
This is really the wrong way to do it. You still send the same number of commands - just delayed - you can still get banned for spamming.

The correct way to do this is to, after sending a command once, add the channel to a variable. Then run a timer so that in X seconds it calls a function, which will then remove the channel from the variable. remember, before sending the command, check if the channel is in the variable.

Ill put something quickly together and post back.
This message brought to you by the Wonderful Wizard of Oz.

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: [Request] Variable Autoresponse Code
« Reply #6 on: October 19, 2008, 11:06:06 PM »
Here you go. Check out the ONTEXT sub at the bottom to see the syntax of how to use this flood protection.

Code: [Select]
seconds = 10

Sub RemoveFloodProtection(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  WriteINIFile "flood.ini",Net,Chan,""
End Sub

Sub FloodProtect(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  WriteIniFile "flood.ini",Net,Chan,"1"
  SendCommand "/scid " & Net & " /timer FloodProtect:" & Mid(chan,2) & " 1 " & seconds & " /! RemoveFloodProtection " & net & " | " & chan
End Sub

Function FloodProtected(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  if int(GetIniFile("flood.ini",Net,Chan,0))=1 then
    FloodProtected = True
  else
    FloodProtected = False
  end if
End Function

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
  if not FloodProtected(Servernumber,Channel) then
    if message="!test" then
      FloodProtect ServerNumber, Channel
      SendCommand "/msg " & channel & " Test success! !test will not work for another " & seconds & " seconds.",ServerNumber
    end if
  End if
End Sub
This message brought to you by the Wonderful Wizard of Oz.

-.-**

  • Newbie
  • *
  • Posts: 2
Re: [Request] Variable Autoresponse Code
« Reply #7 on: October 29, 2008, 12:52:13 PM »
WOW! Holy crap!

I didn't get an E-Mail saying that i had new replies so i thought it ws a dead topic. Thanks for all the help i'll try it.

Here you go. Check out the ONTEXT sub at the bottom to see the syntax of how to use this flood protection.

Code: [Select]
seconds = 10

Sub RemoveFloodProtection(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  WriteINIFile "flood.ini",Net,Chan,""
End Sub

Sub FloodProtect(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  WriteIniFile "flood.ini",Net,Chan,"1"
  SendCommand "/scid " & Net & " /timer FloodProtect:" & Mid(chan,2) & " 1 " & seconds & " /! RemoveFloodProtection " & net & " | " & chan
End Sub

Function FloodProtected(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  if int(GetIniFile("flood.ini",Net,Chan,0))=1 then
    FloodProtected = True
  else
    FloodProtected = False
  end if
End Function

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
  if not FloodProtected(Servernumber,Channel) then
    if message="!test" then
      FloodProtect ServerNumber, Channel
      SendCommand "/msg " & channel & " Test success! !test will not work for another " & seconds & " seconds.",ServerNumber
    end if
  End if
End Sub

Ok, you gotta remember that im a total newbie to this. I don't know how to edit that function to suit what i want it to say. A small tut? Pweez?

Thanks!
« Last Edit: October 29, 2008, 12:54:37 PM by -.-** »

DarkStar

  • Full Member
  • ***
  • Posts: 135
  • Scripts for Praise
    • CorpseCorp
Re: [Request] Variable Autoresponse Code
« Reply #8 on: October 29, 2008, 01:23:55 PM »
The script you used previously and the code I wrote are not compatible with eachother. I rewrote your simple script and included it in this code. Look specifically at the ONTEXT sub.

Code: [Select]
seconds = 10

Sub RemoveFloodProtection(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  WriteINIFile "flood.ini",Net,Chan,""
End Sub

Sub FloodProtect(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  WriteIniFile "flood.ini",Net,Chan,"1"
  SendCommand "/scid " & Net & " /timer FloodProtect:" & Mid(chan,2) & " 1 " & seconds & " /! RemoveFloodProtection " & net & " | " & chan
End Sub

Function FloodProtected(tmp,Chan)
  if isnumeric(tmp) then
    Net = GetIdentifier("$network",tmp)
  else
    Net = tmp
  end if
  if int(GetIniFile("flood.ini",Net,Chan,0))=1 then
    FloodProtected = True
  else
    FloodProtected = False
  end if
End Function

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
  if not FloodProtected(Servernumber,Channel) then
    if message="!hello" then
      FloodProtect ServerNumber, Channel
      SendCommand "/msg " & channel & " Hello " & nickname & ", how are you?",ServerNumber
      SendCommand "/msg " & channel & " Welcome to " & channel,ServerNumber
    end if
  End if
End Sub

Furthermore you can read my basic scripting tutorial here:

http://www.icechat.net/forums/index.php?topic=1104.0

And if you have any questions you can see If I am on #icechat or post back here.
This message brought to you by the Wonderful Wizard of Oz.