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.

Taking an input from a shell command

Old posts that have not been replied to for several years.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

I don't see anything wrong, so here's a few guesses :)

Maybe it's having trouble seing the bot (wrong botname).
One way to find out is to use putallbots instead of putbot.

Replace

Code: Select all

putbot Turbo-BW "bwmsg ..."
With

Code: Select all

putallbots "bwmsg ..."
That'll make any bot in the botnet with the bwmsg bind respond.

If that doesn't help, try changing the bind from +W to +b

And if the msg is too long, it might be cut off by the irc-server, and you get nothing.
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

well i think i have it working... just through trial and eror... i've gone through about 6 lots of hair....

one question i have:

all my bots have the nick Turbo-<2 or 3 char ref>

i want the script to take out the last 2 chars and put them in a var that i can use in the reply.

this is what i got so far

Code: Select all

   set serverbw [lindex [split $botnick \-] 1]
but i get a tcl error

Code: Select all

Tcl error [botnetusage]: can't read "botnick": no such variable
now i've used that variable as part of the trigger on the other script and it works fine... y can i not use it there?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

It's a global var, so you either have to define it inside your proc, using 'global', or use $::botnick instead of $botnick.
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

works a treat mate... cheers....

i used $::botnick and it worked... how would i use "global"?

and see... i can do something's by myself!!!!!
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

set fruitname "oranges"

bind pub -|- !fruit pub:fruit
proc pub:fruit {n u h c a} {
 global fruitname
 putserv "PRIVMSG $c :Today's fruit is $fruitname!"
}
Locked