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 

Forward.tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed Mar 16, 2005 12:35 am    Post subject: Forward.tcl Reply with quote

HI

i`ve install forward.tcl and it works fine , too fine lol the thing that happen is when people log themselves with /msg botnick id password the bot relay that info on the channel exposing the user password to the public

is there a way to prevent that without compromising the use of the tcl ?

thanks

here`s the code
Code:

#This is tcl to forwaring msgs on private to channel. It's simple and so funny :>
#skript za printirane na msg-tata na privat v izbran kanal :> da se posmeem
#
#                              r0gUe gad@c4.com
#
#blagodarnosti na Himika :> Thanks himik :P   

bind msgm - "*" proc:laina
#seting the channel to forward | Setvame si kanala za forward na replikite i ... da se posmeem
set chan "#tequila-sunrise"
proc proc:laina {nick uhost hand arg} {
global chan
set line [string trim $arg]
if {$nick == "SeenServ"} {
      puthelp "privmsg $chan :SeenServ returned: $line"
      return 0
      }



puthelp "PRIVMSG $chan :$nick on private: '$line'"
}
return 0
putlog "Forward loaded"
 


thanks for any advice and or fixes Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Mar 16, 2005 1:41 am    Post subject: Reply with quote

This line displays the password:

Code:

      puthelp "privmsg $chan :SeenServ returned: $line"


You can either remove it or comment it.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed Mar 16, 2005 2:43 am    Post subject: Reply with quote

i did remove the line and it still display the password when somebody do /msg botnick id password
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Mar 16, 2005 4:00 am    Post subject: Reply with quote

There are 2 lines.

puthelp "PRIVMSG $chan :$nick on private: '$line'"

Basically, all the text typed after the trigger, or if it is "*" everything typed will be displayed in $line.

Code:

if {$nick == "SeenServ"} {
      puthelp "privmsg $chan :SeenServ returned: $line"
      return 0
      }
puthelp "PRIVMSG $chan :$nick on private: '$line'"
}


This code basically does the same thing, if nick is SeenServ, do the samething, display $line to same chan, and if it is not, also do the samething and display $line with $nick who triggered the bind.

Basically this script will just message the chan $chan if someone privmsg's the bot. If the nick is SeenServ it will display a different text but with the same argument $line.

Since you have binded "*" it will trigger on any character said to it which can also be when users try to identify the bot via privmsg. Either change the interaction from prvimsg to notice, or use a trigger of somekind as "*" will trigger anything said to the bot.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Mar 16, 2005 4:22 am    Post subject: Reply with quote

my suggestion would be to create a list of commands not to displays, like "op pass id die rehash restart voice halfop ident host" continue how much you like.
then check via something like
Code:
set ignore 0
foreach exclude $excludelist {
  if { [string match -nocase ${exclude}* $line] } {
    set ignore 1
    break
  }
}
if { $ignore == 0 } {
  ... (send $line)
}
addionally you could check the string against his password, but you'd need to check it against each element of the line as list (foreach element [split $line]).
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed Mar 16, 2005 12:59 pm    Post subject: Reply with quote

i`ve think of something , can i do something like

Code:

bind msgm - "*" proc:laina
set chan "#trois-mousquetaires"
proc proc:laina {nick uhost hand arg} {
global chan
set line [string trim $arg]
if {![validuser [lindex [split $arg] 0]]}  {
      puthelp "privmsg $chan : on me parle en PV , mais chut c un secret:)"
      return 0
      }
else {
puthelp "PRIVMSG $chan :$nick m`as dit en priver: '$line'"
return 0
}

}


so if it is some body known to the bot who msg it it will reply :puthelp "privmsg $chan : on me parle en PV , mais chut c un secret:)" but without saying the $line

then if it is somebody unknown to the bot it will reply the $line

but my code doesnt seems to work for people unknown to the bot
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Mar 16, 2005 3:47 pm    Post subject: Reply with quote

Yes that is also a good idea using validuser to check if the hostmask in the first list index of the output text matches any user on the bots file. Meaning checking if a user is identifying himself.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Mar 16, 2005 3:51 pm    Post subject: Reply with quote

Try this:

Code:

bind msgm - "*" proc:laina

set chan "#trois-mousquetaires"

proc proc:laina {nick uhost hand arg} {
 global chan
 set line [string trim $arg]
 if {![validuser [lindex [split $arg] 0]]}  {
   puthelp "privmsg $chan :on me parle en PV, mais chut c un secret :)"
  } else {
   puthelp "PRIVMSG $chan :$nick m`as dit en priver: '$line'"
   }
 return 0
}


The,

Code:

}
else {


should be
Code:

} else {


If you put else in a new line, the tcl interpreter thinks it is a new if-else statement, in which case it is non-existant for this else.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Mar 16, 2005 4:15 pm    Post subject: Reply with quote

What is the role of a 'string trim' in this case? Or you just copy/paste it's code? Second, what is with 'if {![validuser [lindex [split $arg] 0]]} {' ? make it 'if {[validuser $hand]} {' and 'return' not at the end of the proc, because msgm bind is stackable ('bind multiple commands to the same trigger') where yours is "*".
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed Mar 16, 2005 5:39 pm    Post subject: Reply with quote

i try the last version with the corrections by awyeah and it still doesnt read the $line when it is somebody unknown to the bot who /msg botnick (msg)

i`m a bit lost now

(edit) it display the same thing if it is a user known to the bot or an unknown user : on me parle en PV, mais chut c un secret Smile

maybe adding another "if" for user unknown i dont know what to do
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Pitchat
Op


Joined: 18 Feb 2003
Posts: 122
Location: Hebertville Quebec Canada

PostPosted: Wed Mar 16, 2005 5:48 pm    Post subject: Reply with quote

problem solved !!!

i followed caesar modifications and it worked juste fine !!!

thanks to awyeah ,caesar and De Kus for the help it was a bit fastidious for a little useless but asked script thanks a lot !

*i`m so happy i even smile at my stepmother*
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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