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.

Actions based on keywords with user defined list?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
slaapliedje
Voice
Posts: 5
Joined: Mon Jul 30, 2012 2:08 pm

Actions based on keywords with user defined list?

Post by slaapliedje »

At one point in time a few friends of mine had slapped together an IRC server with a bot. Both were written in Java. When it became apparent that we needed to host it outside of our work environment (they ended up getting new jobs) I decided to start hosting it on my own server.

Problem is, I hate Java, and would rather not have any Java applications running on my public facing server. So I've already replaced the IRC server itself, and I'm in the process of replacing all of the functionality of the bot that we used, and I've landed on using Eggdrop for that purpose.

Most of the functionality is already replaced, and some of it just needs tweaking (like getting the alarms working for when it's time to get out of the office, but I can work on that.)

The one that I haven't been able to find any replacement for is the 'actions' portion.

We had functions like ~addaction, ~dspactions, ~delactions. These would, as one would assume, add an action, display the actions, and delete actions.

The actions were created as such;

Code: Select all

~addaction <action name> <text for action> {1} {2}
As an example, if you typed '~addaction kick kicks {1} hard in the {2}, until {1} bleeds from {2}'

Then you'd type 'kick slaapliedje balls' and the bot would then do an action of 'kicks slaapliedje hard in the balls, until slaapliedje bleeds from the balls'.

We had all sorts of fun with this, as you can imagine.

I have found the Completely Useless Fun Script (cufs.tcl) script from the tcl archive here, but I don't see a way to do nick names, and it also looks in the entire text input rather than just the first word (which does cause a lot of hilarity, but when someone decides to put 'the' or 'and' into it, it gets really annoying really quickly.

Any suggestions on a script already created? I'm just starting to try to get into programming myself, but tcl is probably going to be pretty far down on my list of things to learn, but I can usually read through code and see what it's trying to do.

Thanks for any help or input.

slaapliedje
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Code: Select all

bind pub -|- !kickballs balls_proc

proc balls_proc { nick uhost hand chan text } {
  set ballskicked [lrange [split $text] 0 end] 
  puthelp "privmsg $chan :\001ACTION Kicks $ballskicked hard in the balls till $ballskicked bleeds from the balls\001" 
}
Just type !kickballs usersnickname in the channel not sure if this is exactly what your after but it will do the basic action i`m pretty sure someone could add to it :)
s
slaapliedje
Voice
Posts: 5
Joined: Mon Jul 30, 2012 2:08 pm

Post by slaapliedje »

Close. That would be for a single static action.

Our previous one would allow variables (two of them). And input/output from a text file.

The text file looked like this

Code: Select all

twist=twists {1}'s nipples.
die.bofh=Silence\!  I kill you\!
<3=loves {1} {2}
defecate=defecates on {1}'s {2}.
see=sees what you did there, {1}. Very clever {1}, very clever indeed.
kick.bofh=gives {1} a swift kick in the pants for trying to kick bofh.
gundown=pulls out an uzi and guns down {1}
pardon=pardon me {1}, do you have any gray poupon?
<3.bofh=<3's you too {1}
profit=thinks "1) punch {1} in the {2} 2) laugh ass off 3) ??? 4) profit\!"
bye=waves farewell to {1}
give=gives {1} {2}
highfive.bofh=gives {1} a highfive
You may be able to tell from that list that our bot was named bofh! It started out as a simple bofh bot, using the bofh excuses (I have that part working perfectly with eggdrop).

Hmm, I think I should be able to take your code example and with some of the other scripts out there, craft something together, without a whole lot of tcl knowledge. I'll see what sort of monster I can create, and if it works, obviously I'll upload it here :D

slaapliedje[/quote]
Post Reply