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 Help from IRC Script to TCL

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
J
JoKeR
Voice
Posts: 3
Joined: Tue Nov 14, 2006 10:01 am

Need Help from IRC Script to TCL

Post by JoKeR »

Hi, this is my first message and i know that starting with requestes it's not the right way to start, but I really need that.

So, I don't know anything about TCL scripting...I tried to see some guides but for me it's like Arabic...

I've this IRC script:

Code: Select all

on *:text:!add*:#chan:{ 
  if ($nick == JoKeR) && ($2 != $null) set %access $addtok(%access,$2,32) 
  { msg #lab 14[4Security14] 7 $2 2Succefully Added! }  
} 
on *:join:#chan:{ 
  { msg #lab 14[4Security14] 2Searching for your UserName... }  
  if ($istok(%access,$nick,32) == $false) { 
  mode $chan +b $address($nick,1) | msg #lab 14[4Security14] 2Access not allowed for 7 $nick 2! | kick $chan $nick Access not allowed! Info: JoKeR } 
  if ($istok(%access,$nick,32) != $false) { msg #lab 14[4Security14] 2Access Allowed for 7 $nick ! } 
}
Now I want to transform to TCL script, with some modify:
1) More users can add user to the access list (ex User1, User2, User3)
2) I would use the same TCL for more channel (ex Chan1, Chan2, Chan3)
3) I don't want to ban users that aren't on the access list, but i want to sapart them, or, if it's impossible, to set a timed ban
4) Add a !del command that leave the nick from the access list

If you could do it, please also explane me how the script is maked, so next time i would try by myself.

Thx (Sorry I don't know if my English is correct, I'm from Rome!) :D
irc.HellIRC.Org - The Power of IRC
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

This forum is not for translating mIRC to TCL, it's a "requests" forum. This means, request a script and maybe someone will implement it for you.

Also, did you try to search the Tcl Archive? This seems like a blacklist script (you can also use Eggdrop's internal banlist for this).
J
JoKeR
Voice
Posts: 3
Joined: Tue Nov 14, 2006 10:01 am

Post by JoKeR »

Ok sorry...I tried to do by myself with some guides but I don't know if it's correct or not.

Code: Select all

bind pub - !add pub:add 
bind join - "#lab *" evnt:join 

proc pub:add {nick uhost hand chan arg} { 
  global access 

  if {[string equal -nocase $nick JoKeR] || [string equal -nocase $nick OtherNick] || [string equal -nocase $nick ThirdNick]} {  
    lappend access($chan) $arg
  } 
  puthelp "PRIVMSG $chan :\00314[\00304Security\00314] \00307 $arg \00302Insertio Con Successo!\003" 
} 

proc evnt:join {nick uhost hand chan} { 
  global access 

  if {[lsearch access($chan) $nick]} { 
    newchanban $chan *!$uhost - "\00314[\00304Security\00314] \00302 Access not allowed \003" 
  } else { 
    puthelp "PRIVMSG $chan : \00314[\00304Security\00314] \00302 Access Allowed for \00302${nick}!\003" 
  } 
}
Can you tell me if it's correct? It should set different access listes, one for each chan, and different nicks should add users to the access list.
One thing I can't do...the command !del
Now can you help me?
thx
irc.HellIRC.Org - The Power of IRC
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Why don't you try it out and see yourself?

Also, You need to check the lsearch return for either -1 or anything else, what you use right now would also ban the *first* user on your little access list.

(Also, checking specifically by nick is stupid, very stupid. If someone uses your nick, he can use your script)

Bind the flag to a proper flag instead and make sure the eggdrop knows you at all times.
J
JoKeR
Voice
Posts: 3
Joined: Tue Nov 14, 2006 10:01 am

Post by JoKeR »

It doesn't found...I don't understand why...
Please Help :(

-------EDIT-------------

I tried and i tried...this is the result:

Code: Select all

[21:17] <JoKeR> .:( 21:16"17 ):. <POiNT|SECURiTY> [15:17] Tcl error [pub:add]: invalid command name "Security"
[21:17] <JoKeR> .:( 21:16"26 ):. <POiNT|SECURiTY> [15:17] Tcl error [evnt:join]: invalid command name "Security"
Why?
irc.HellIRC.Org - The Power of IRC
J
Justdabomb2
Voice
Posts: 37
Joined: Fri Sep 29, 2006 7:16 pm
Location: United States of America

Post by Justdabomb2 »

it thinks you are trying to use "security" as a command because it is in bewteen [ and ]. If you want the bracktes to show up on the message to the channel , use "\[" and "\]"
Yeah!
Post Reply