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.

need a TCL script plz help me!! ;(

Old posts that have not been replied to for several years.
Locked
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

need a TCL script plz help me!! ;(

Post by hide »

Hi everybody!
We've have user a windows server before where ircd was running but now we upgraded to linux and I'm messed up. We used a mirc client acting as a bot which had only this single script:

ON 1:JOIN:#Main:{
if (( %send. [ $+ [ $address($nick,2) ] ] == $null ) && ( cht-v3.1 isin $address )) {
.dcc send -c $nick c:\vkt.ini
}
elseif (( %send. [ $+ [ $address($nick,2) ] ] == $null ) && ( off isin $address )) {
.dcc send -c $nick c:\vkt.ini
}
}
on 1:FILESENT:vkt.ini:/set %send. [ $+ [ $address($nick,2) ] ] sent


Could anybody of you rewrite this script into a tcl so it could run on eggdrop, please. I've tried to do it by myself but everything goes wrong because I'm lame at this. I need only this script, nothing more.. please help somebody. It would be glad to get off somebody a good responce. Thanks!
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Am, dont know if i understood good.But this script works like this: If user comes on channel named #main bot send him file vtk.ini ?
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

Post by hide »

absolutely right! If a user who has ident cht-v3.1 or off comes to channel main, bot sends him the file vkt.ini and puts his address into a listso if the same user comes to channel again, bot won't send him the file again.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Code: Select all

bind join - * join:pub

proc join:pub {nick host hand chan} {
  dccsend file.txt $nick
}
this is just plain on join dccsend
XplaiN but think of me as stupid
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

Post by hide »

well, any ideas how to do for bot not to send the file for the same user?
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Yeah, use this code:

Code: Select all

set myfile "send.txt"
bind join - * join:pub

proc join:pub {nick host hand chan} {
  global myfile
  set read [open "myfile" r]
  while {[gets $read line] != -1} {
    if {[string equal -nocase "$line" "$nick"]} {
      close $read
      return 1
    }
  }
  dccsend file.txt $nick
  set file [open "$myfile" a]
  puts $file "$nick"
  close $file
  close $read
}
This will write the nicks in a txt file and won't send the file to a nick that is written in the file :P
Xpert.
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

Post by hide »

I think I'm having problem: when a person joins, it claims: [19:07] TCL error [join:pub]: invalid command name "dccsend". What should I do? And the last my question is: I want to send the file only for people having ident "cht-v3.1" and "off" but not for all? Where can I set it?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

What is the point on the while when he just asked for an ident match and send a file? Also, if you want to stop an while proc just use "break" or "continue" to continue with the loop. I honest do belive that this dcc send thing is not secure and I do not recomand you go only via idents matches. better make host masks matches or something similar. Anyway.. you wanted it so here it is.

Code: Select all

set sendfile "myfile.txt" 
bind join - * join:send

proc join:send {nick uhost hand chan} { 
  if {[isbotnick $nick]} {
    return
  }
  set ident [lindex [split $uhost @] 0]
  if {![regexp -all {cht-v3.1|off} $ident]} {
    return
  }
  dccsend $::sendfile $nick 
}
Also, be sure the file system is loaded.
Once the game is over, the king and the pawn go back in the same box.
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

Post by hide »

but still.. I don't know why, but eggdrop doesn't understand the "dccsend" command :-?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Is that file system module loaded? What version of eggdrop and TCL you have? Also, haven't noticed the specific channel you want this to run on so replace this:

Code: Select all

if {[isbotnick $nick]} {
with:

Code: Select all

if {[isbotnick $nick] || ![string equal -nocase "#main" $chan]} {
Once the game is over, the king and the pawn go back in the same box.
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

Post by hide »

version of eggdrop is 1.6.8, loadable modules are here:
source /usr/share/eggdrop/scripts/alltools.tcl
source /usr/share/eggdrop/scripts/action.fix.tcl
source /usr/share/eggdrop/scripts/compat.tcl
source /usr/share/eggdrop/scripts/userinfo.tcl
source /usr/share/eggdrop/scripts/dcc.tcl
loadhelp /usr/share/eggdrop/help/userinfo.help
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Thouse are scripts not modules.. scroll a bit up! Drop the "/usr/share/" thing if the eggdrop is in the same dir as thouse files.
Once the game is over, the king and the pawn go back in the same box.
h
hide
Voice
Posts: 26
Joined: Mon Dec 22, 2003 12:02 pm

Post by hide »

THX! :) I've put there filesys and transfer modules and it's working!! thx guys, you're perfect 8) but still.. it would be very good to do that the script would send the file only one time because this will work on a LAN chat were are about 700 lame users who very dislike seeing the message 'dcc send file.txt' in their status window.. I've messed up trying to join those two scripts together :)
Locked