| View previous topic :: View next topic |
| Author |
Message |
masheen Voice

Joined: 28 Apr 2007 Posts: 28
|
Posted: Wed May 02, 2007 4:12 am Post subject: on *:input:#: (MIRC+TCL) request (solved) |
|
|
hi again. first of i have a question... is it possible for the BOT to add a channel to join by itself? if yes heres a request i have and hope sum1 can help me on this:
(This is an idea i got from arfer's bot(colossus) on dalnet channel #tcl)
1. from the mirc script:
| Code: | on *:input:#:{
if ($nick == mynick) && ($1 == come) { .msg botname join # }
if ($nick == mynick) && ($1 == goaway) { .msg botname part # }
} |
2. Botside - when the bot recieves the message from mynick it adds the channel from its internal channels list (not sure if its possible without DCC-ing the bot to add chan) and joins the channel where the word come was triggered or parts the channel if the word goaway is triggered. any help you guys can spare is greatly greatly appreciated. i was told by arfer its not a difficult script for the great scripters of this forum. hope m not asking too much. _________________ let he who is without stone cast the first sin
Last edited by masheen on Wed May 02, 2007 11:51 am; edited 1 time in total |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Wed May 02, 2007 6:56 am Post subject: |
|
|
| Code: | bind pub o come script:join
proc script:join {nick uhost hand chan text} {
set text [split $text]
set cchannel [lindex $text 0]
set key [lindex $text 1]
if {$cchannel == ""} {puthelp "NOTICE $nick :You need to supply a channel name."; return}
if {$key != ""} {putquick "JOIN $cchanel $key"; return}
putquick "JOIN $cchannel"
putquick "NOTICE $nick :Just joined $cchannel."
}
bind pub o goaway script:leave
proc script:leave {nick uhost hand chan text} {
set text [split $text]
set pchannel [lindex $text 0]
if {$pchannel == ""} {puthelp "NOTICE $nick :You need to supply a channel name."; return}
channel remove $pchannel ; utimer 1 save
putquick "NOTICE $nick :Just parted $pchannel."
}
putlog "Join - part tcl loaded by iamdeath." |
I have'nt tested it, but should work. To make it work, you should have atleast "o" flags. Make sure you're properly added with o flags and then try. Let me know if it works and yes, it works when the msg comes from the channel, if you want it a /msg let me know i'll edit it.
iamdeath _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
masheen Voice

Joined: 28 Apr 2007 Posts: 28
|
Posted: Wed May 02, 2007 8:11 am Post subject: |
|
|
thanks for the fast reply iamdeath much appreciated. problem is, it has to be like this... say i am on #chan without my bot. and i want for it to join the chan... so i type the word come right? and on my mirc script, there are line that wil recognize what i just say and then my script will automatically query the bot:
| Code: | on *:input:#:{
if ($nick == mynick) && ($1 == come) { .msg botname join # }
if ($nick == mynick) && ($1 == goaway) { .msg botname part # }
} |
and when the bot recieves a query message: join #chan from me, it will then add #chan to its internal channel list (again not sure if this is possible with out manualy configureing the bot or with DDC add chan) and then joins the channel. same thing if i say goaway. my mircscript will capture my on *:input:# --> goaway and triggers the /msg botname part #chan
just a thought: the goaway command doesnt necesarily have to be like the come command in a sense that, the bot cud just capture that i just sed goaway in a channel and it'l know that it has to part that channel without me /msg-ing him to part #chan... i hope i am clear what do u think iamdeath? _________________ let he who is without stone cast the first sin |
|
| Back to top |
|
 |
masheen Voice

Joined: 28 Apr 2007 Posts: 28
|
Posted: Wed May 02, 2007 9:20 am Post subject: solved |
|
|
ei thanks for the idea iamdeath i got it to finally work heres the code:
NOTE: excuse the naming convention hehe, ill change it later. and dont wori bout the security il fix dat later (bind -|- intentional).
| Code: | bind msg -|- entra kick:msg
bind msg -|- chupi kick:sale
proc kick:msg {nick uhost hand arg} {
global botnick
set kchan [lindex $arg 0]
set knick [lindex $arg 1]
set kreason [lrange $arg 2 end]
channel add $kchan
putquick "JOIN $kchan"
putquick "NOTICE $nick :Just joined $cchannel."
}
proc kick:sale {nick uhost hand arg} {
global botnick
set kchan [lindex $arg 0]
set knick [lindex $arg 1]
set kreason [lrange $arg 2 end]
channel remove $kchan
putquick "NOTICE $nick :Just joined $cchannel."
}
putlog "Join/Part tcl loaded by iamdeath." |
my last request instead is if anyone can put an onjoin msg for the bot. meaning, if i call it to a chan, and when it joins it says sumting, like putserv "PRIVMSG $chan :bot has arrived."shud i incorporate the onjoin on this script or shud i make a separate one for the onjoin? thanks thanks thanks in advance. _________________ let he who is without stone cast the first sin |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Wed May 02, 2007 11:10 am Post subject: |
|
|
| Code: | bind msg -|- entra kick:msg
bind msg -|- chupi kick:sale
proc kick:msg {nick uhost hand arg} {
set kchan [lindex $arg 0]
channel add $kchan
putquick "JOIN $kchan"
putserv "PRIVMSG $kchan :Here I am."
}
proc kick:sale {nick uhost hand arg} {
set kchan [lindex $arg 0]
channel remove $kchan
putquick "NOTICE $nick :I left that channel."
}
putlog "Join/Part tcl loaded by iamdeath." |
EDIT: Removed botnick, kreason, knick and cchannel, as they were not being used, yes now when the bot will join a channel, it will msg in that channel "Here I am." and when it leave it will send a notice to that person, that I left.
| Quote: | | thanks for the fast reply iamdeath much appreciated. problem is, it has to be like this... say i am on #chan without my bot. and i want for it to join the chan... so i type the word come right? and on my mirc script, there are line that wil recognize what i just say and then my script will automatically query the bot: |
That is not possible, even if egghelp release 100000 versions of eggdrop. The thing is, if a bot is not in any channel and you type something in that channel how the heck will the bot know what goes around there ehh.. So it's your mIRC script which makes a query to the bot, again it's a query to the bot. But the way you want is only possible with a mIRC script or 2 bots linked and that 1 bot is present in that channel which can transfer the text to the different bot. With 1 bot who is not in that channel it's impossible to make it perform any command.
Cheers  _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
masheen Voice

Joined: 28 Apr 2007 Posts: 28
|
Posted: Wed May 02, 2007 11:44 am Post subject: |
|
|
haha it is possible its a mirc+tcl stuff i did. its working now.. very simple actualy... my mirc does the work.... i type in come in in the channel wer the bot is not there, and then the irc script triggers the word come in then sends the query command to the bot: join # which in turn the bot responds to my query by joining the channel i just gave it the command to join. thanks for the help! very very much appreciated! i think the case is solved now. i have some stuffs working on and i might nid ur help again later. thanks for heping us noobs get started. again, it is people like u dat inspire us to be better. REP points added to yah on my list. ehehe _________________ let he who is without stone cast the first sin |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed May 02, 2007 4:52 pm Post subject: |
|
|
Unfortunately, I have to repeat myself on and on... Hope this time you'll get it.
| Quote: | | DO NOT APPLY LIST COMMANDS ON STRINGS (and vice versa) |
| iamdeath wrote: | | Code: | proc kick:msg {nick uhost hand arg} {
set kchan [lindex $arg 0]
[snip] |
|
$arg is a STRING, [lindex] is a LIST command. For this reason, you [split] $arg to convert it into a LIST.
| Code: | | set kchan [lindex [split $arg] 0] |
Not too hard... _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Wed May 02, 2007 7:57 pm Post subject: |
|
|
aight, I'll keep that in mind  _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
|