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.

on *:input:#: (MIRC+TCL) request (solved)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
masheen
Voice
Posts: 28
Joined: Sat Apr 28, 2007 1:14 pm

on *:input:#: (MIRC+TCL) request (solved)

Post by masheen »

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: Select all

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.
Last edited by masheen on Wed May 02, 2007 11:51 am, edited 1 time in total.
let he who is without stone cast the first sin
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Code: Select all

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*...
User avatar
masheen
Voice
Posts: 28
Joined: Sat Apr 28, 2007 1:14 pm

Post by masheen »

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: Select all

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
User avatar
masheen
Voice
Posts: 28
Joined: Sat Apr 28, 2007 1:14 pm

solved

Post by masheen »

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: Select all

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
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Code: Select all

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.
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 :D 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 :D
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
masheen
Voice
Posts: 28
Joined: Sat Apr 28, 2007 1:14 pm

Post by masheen »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Unfortunately, I have to repeat myself on and on... Hope this time you'll get it.
DO NOT APPLY LIST COMMANDS ON STRINGS (and vice versa)
iamdeath wrote:

Code: Select all

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: Select all

set kchan [lindex [split $arg] 0]
Not too hard...
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

aight, I'll keep that in mind :P
|AmDeAtH @ Undernet
Death is only the *Beginning*...
Post Reply