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.

[SOLVED] Relay

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

[SOLVED] Relay

Post by Fire-Fox »

All solved here is howto

BOT1 - Where the data goes

Code: Select all

bind bot -|- relay get:relay

proc get:relay {bot command text} {
set trigger [join [lrange [split $text] 0 0]]
set message [join [lrange [split $text] 1 end]]
putlog "recieved $trigger from $bot"
putnow "privmsg #CHAN :$trigger $message"
}
putlog "Reciever Relay.Tcl - Loaded By Fire-Fox"

BOT2 - Where you get your data from

Code: Select all

bind pubm - "*!trigger1*" send:relay
bind pubm - "*!trigger2*" send:relay
bind pubm - "*!trigger3*" send:relay
bind pubm - "*!trigger4*" send:relay

proc send:relay {nick host hand chan text} {
set trigger [join [lrange [split $text] 0 0]]
set message [join [lrange [split $text] 1 end]]

putlog "sent $text"
putbot "BOTNET-NICK" "relay $trigger $message"
}
putlog "Relay Source.Tcl - Loaded By Fire-Fox"
Last edited by Fire-Fox on Tue Mar 06, 2012 5:36 pm, edited 2 times in total.
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You set send:text to all 4 binds, so you need to fix that before anything else. As for your question, you can change % with the actual channel name. For example:

Code: Select all

bind pubm - "#something !test*" send:something
bind pubm - "#another !test*" send:another
Once the game is over, the king and the pawn go back in the same box.
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

So it also gives info on diffrent chans?

IE:

bind pubm - "#something !test*" send:something goes to #Chan1

and

bind pubm - "#another !test*" send:another goes to Chan2
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

No, send:* are procs that you should define. :) For example:

Code: Select all

proc send:something {nick host hand chan text} { 
 # do something
}

proc send:another {nick host hand chan text} { 
 # do something else
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

First post updated
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Post Reply