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.

Forward.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Forward.tcl

Post by Pitchat »

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

#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 :)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This line displays the password:

Code: Select all

      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.
==================================
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

i did remove the line and it still display the password when somebody do /msg botnick id password
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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

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.
==================================
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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

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...
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

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

Code: Select all

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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
==================================
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Try this:

Code: Select all

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

}
else {
should be

Code: Select all

} 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.
==================================
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

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 :)

maybe adding another "if" for user unknown i dont know what to do
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

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*
Post Reply