This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

slap back

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
J
Joatle
Voice
Posts: 2
Joined: Wed Jun 13, 2007 7:45 pm

slap back

Post by Joatle »

Can someone make an slap back script that makes the bot slap people back when it get slaped?

Would also be nice if there was some random there..

like:

* nick slaps bot around a bit with a large trout
* Bot slaps Nick around..
* nick slaps bot around a bit with a large trout
* Bot slaps Nick right back..
* nick slaps bot around a bit with a large trout
* Bot slaps Nick over the head with an dead cat..

Something like that..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

set actReplies {
 "around..."
 "right back.."
 "over the head with an dead cat.."
}

bind ctcp - ACTION slap:back

proc slap:back {nick uhost hand chan kw arg} {
 global botnick actReplies
 if {![validchan $chan]} {return 0}
 if {[string match "slaps $botnick around a bit with a large trout" $arg]} {
  puthelp "privmsg $chan :\001ACTION slaps $nick [lindex $actReplies [rand [llength $actReplies]]]\001"
 }
}
J
Joatle
Voice
Posts: 2
Joined: Wed Jun 13, 2007 7:45 pm

Post by Joatle »

that was quic :) :)

Thanks :)
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Post by romeo5k »

nice... i needed this too.. now i need the slap attack one.. http://forum.egghelp.org/viewtopic.php?t=13585

Thank you.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

That will get you no closer.

You will wait, you will be patient, you will make an attempt on your part instead of sitting back and doing nothing.

It would be a good idea (using the resources of these forums) to at least attempt writing your own script or modifying another. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Post by romeo5k »

alchera i did, and i got a result, but the result had a problem, and no one has responded yet in maybe 4 days or so. Thats why i'm giving up on it. Cause it seems i have a problem no one has ever heard of.

http://forum.egghelp.org/viewtopic.php?t=13593
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

That is so simple to figure out and that is why no-one has responded as it is actually staring you right in the face; you actually have the script sending the text twice to the channel.

Remove either of these lines:

Code: Select all

putserv "PRIVMSG $chan :\001ACTION slaps $target around a bit with a larger trout\001"
puthelp "PRIVMSG $chan :\001ACTION slaps $target around a bit with the remains of a big Smelly Trout!\001"
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Post by romeo5k »

m
mindcry
Voice
Posts: 10
Joined: Mon Mar 05, 2007 10:24 am
Location: Central Java Indonesia

simple action reverser

Post by mindcry »

proc act:reply {nick uhost hand chan arg} {
global botnick
regsub -all -nocase $botnick $arg $nick arg
putserv "PRIVMSG $chan :\001ACTION $arg\001"
}

its better idea to make another procedure to stops action floodings on channel. :lol:
mindcry
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Re: simple action reverser

Post by Alchera »

mindcry wrote:its better idea to make another procedure to stops action floodings on channel. :lol:
It's a better idea to enclose code within tags.

Please edit your post accordingly.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
m
mindcry
Voice
Posts: 10
Joined: Mon Mar 05, 2007 10:24 am
Location: Central Java Indonesia

action reverse

Post by mindcry »

Code: Select all

bind CTCP - ACTION act:reply

proc act:reply {nick uhost hand dest key arg} {
  global botnick
  if {[validchan $dest]} {
  set chan [string tolower $dest]
  if {![string match -nocase *$botnick* $arg] || ![onchan $nick $chan]} {return 0}
  regsub -all -nocase $botnick $arg $nick arg
  putserv "PRIVMSG $chan :\001ACTION $arg\001"
}
this code will do action reverse if someone slapping (or anything) to your bot. adding anti flood procedure will make this code better. :)

ty for your opinion alchera.
im newbie in here :D
mindcry
Post Reply