egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dunno how i should solve this :S [Solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
bootdisk
Voice


Joined: 11 Jun 2007
Posts: 12

PostPosted: Mon Jun 11, 2007 11:07 am    Post subject: Dunno how i should solve this :S [Solved] Reply with quote

Ok, i have some problem with a request script that i found on this forum.

The script is basic request from metroid and "modified" by Tosser^^.

I have talked to both of them about this, mostly metroid.

I can post the part of the request script that Tosser^^ modified first and then say what my problem is.

Code:


# Basic Request script


  # Request is accepted
  putquick "NOTICE $nickname :Your request is accepted. $bot will join $channel."
  putquick "PRIVMSG $request::homechan :Request from $nickname for $channel was accepted. The channel has [llength [chanlist $channel]] users."
  putbot "$bot :rjoin $channel $nickname *![getchanhost $nickname]"
  channel remove $channel
 }
}

proc request::version {} {
 putlog "Basic Request script version: $request::version by $request::author was loaded successfully."
}
   
request::version


Thats the script that is loaded on the main bot.

Here is the leaf script

Code:

bind msg H| rjoin request:dojoin

proc request:dojoin { channel nickname hostname handle text } {
 set channel [lindex [split $text] 0]
 set nick [lindex [split $text] 1]
 set host [lindex [split $text] 2]
 if {![validuser [nick2hand $nick]]} {
   channel add $channel
   adduser $nick $host
   chattr $nick |+n $channel
  } else {
   chattr [nick2hand $nick] |+n $channel
 }
 putserv "NOTICE $nick :Hello $nick. Im your new bot. Your added to my userlist as '[nick2hand $nick]' with the hostname '$host'. Enjoy!"
}



So, my problem is that the leaf script. It wont join the channel.

And in the partyline on the leaf bot i get this
Code:

Tcl error [request:dojoin]: no such channel


So im wondering if this leaf script can be rewriten so the main bot sends a command trough the botnet insteed of privmsg?

And if i use putbot on the mainbot to call the leaf-bot, how should i bind the the stuff in the leaf script?


Best Regards
bootdisk

PS. Dont know if im just guessing now, but maybe im on the right way? :S


Last edited by bootdisk on Mon Jun 11, 2007 1:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jun 11, 2007 11:55 am    Post subject: Reply with quote

Your argument-list in request:dojoin is not in order.
doc/tcl-commands.doc wrote:
(1) MSG
bind msg <flags> <command> <proc>
procname <nick> <user@host> <handle> <text>

Description: used for /msg commands. The first word of the user's
msg is the command, and everything else becomes the text argument.
Module: server


Hence the argumentlist should be something like "nickname uhost handle text".

As for sending messages through the botnet, you would use putbot to send the message, and create a binding of type "BOT" to recieve the message. Adopting your current script should be a mere matter of replacing the line sending the msg to leafbot, with putbot (message could be the same); and changing the binding and arguments for request:dojoin to use a BOT-binding rather than a MSG-binding.

doc/tcl-commands.doc wrote:
putbot <bot-nick> <message>
Description: sends a message across the botnet to another bot. If no
script intercepts the message on the other end, the message is
ignored.
Returns: nothing
Module: core

...

(18) BOT
bind bot <flags> <command> <proc>
proc-name <from-bot> <command> <text>

Description: triggered by a message coming from another bot in
the botnet. The first word is the command and the rest becomes
the text argument; flags are ignored.
Module: core

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
bootdisk
Voice


Joined: 11 Jun 2007
Posts: 12

PostPosted: Mon Jun 11, 2007 12:11 pm    Post subject: Reply with quote

Uhm, sorry but i dont get it :/

First time im looking at TCL or code, but what i do know (or i guess) is that this script should be faster with botnet binds/procs rather then msg?

Maybe you can give me a hint on the that i should use in the main script?

Edit: Thanks for answer my post Smile
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jun 11, 2007 12:17 pm    Post subject: Reply with quote

Ah well, we're all beginners at sometime.

Your current issue is that this:
Code:
proc request:dojoin { channel nickname hostname handle text } {

does not match the list of parameters provided when the msg-binding triggers (being: "nickname user@host handle text"). What you need todo is modify the list of arguments (channel nickname hostname handle text) to match these. Names of the arguments does not matter (with the exception of "args"), however the number of parameters and arguments must match (one parameter per argument.

Change the above mentioned line into something like this:
Code:
proc request:dojoin {nickname uhost handle text} {

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
bootdisk
Voice


Joined: 11 Jun 2007
Posts: 12

PostPosted: Mon Jun 11, 2007 12:29 pm    Post subject: Reply with quote

Thanks for the help mnl Smile

The script is working now Smile

Now i have to find some other script that i can use for fun Smile

Thanks mate!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber