Author Topic: Anti Slap  (Read 6538 times)

RedMonger

  • Guest
Anti Slap
« on: April 24, 2005, 09:28:20 AM »
help me.. help me

I'm getting slapped left and right in the chat rooms, which can be funny, however I see allmost all the other ppl have some sort of counter slap script set up.

For example if I would slap john with a trout
then shows
*john pulls out his sword and chops of $Nick, arms and watches him run around the room while $Nick s arms lay on the floor flopping like trout.

I'm not very good at all this scripting can someone help me plz. or just lead me in the direction.

Thanks

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Anti Slap
« Reply #1 on: April 24, 2005, 12:28:00 PM »
Well, most slaps are Actions in a channel, so you would use the ONACTION Script Event. What you can then do is look for the word "slap" and your nickname, in the action, and then send an action back, with the /describe command, which sends an action like /me, but directs it to a specific channel.
Something like this:
Code: [Select]

Sub ONACTION(Message,Channel,Nickname,Host,ServerNumber)
'this subroutine fires any time there is a channel action
'this checks for the word "slap" and your current nickname in the Message
if instr(lcase(Message),"slap") and instr(Message,MyNickName(ServerNumber)) then
SendCommand "/describe " & Channel & " pulls out a sword and chops " & NickName & "'s arms off",ServerNumber
end if
End Sub
The IceChat God

forte.exe21

  • Newbie
  • *
  • Posts: 19
Anti Slap
« Reply #2 on: April 26, 2005, 07:23:42 AM »
well, i copied then pasted it but it wont work. or am i supposed to edit something in there?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Anti Slap
« Reply #3 on: April 26, 2005, 08:45:32 AM »
Are you saving it?  Are you updating, from the Menu?
My guess is, you just cut and paste it, and closed.

You need to save the data to a file, and then from the main menu, close and update.
The IceChat God

forte.exe21

  • Newbie
  • *
  • Posts: 19
Anti Slap
« Reply #4 on: April 26, 2005, 07:55:57 PM »
Quote from: Snerf
Are you saving it?  Are you updating, from the Menu?
My guess is, you just cut and paste it, and closed.

You need to save the data to a file, and then from the main menu, close and update.


i also did that.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Anti Slap
« Reply #5 on: April 26, 2005, 08:26:05 PM »
Its probably because the formating is wrong, as there is a linefeed in the text, when there is not supposed to be one.
The "Sendcommand" line is all supposed to be on a single line, all the way to the end ", ServerNumber", even though it shows as 2 seperate lines.
The next line should then be the "End If" line.
This is why I usually dont like posting scripts in the forum, because the formatting shows incorrectly.
The IceChat God

forte.exe21

  • Newbie
  • *
  • Posts: 19
Anti Slap
« Reply #6 on: April 26, 2005, 09:10:45 PM »
thanks it finally worked.