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.

help with onjoin/managing files

Old posts that have not been replied to for several years.
Locked
M
Mike N.

help with onjoin/managing files

Post by Mike N. »

Hi, i need some help with this onjoin tcl. I want to have two files, one with HOSTMASKS of the ppl that will be msged like this:

Code: Select all

---hosts.txt---

*@*.anything.br
*@*.something.tw
*ident@229.9.89.*
clone*!*@*
etc.

------ . ------
and one with list of NICKS that WONT be msged like this:

Code: Select all

---nicks.txt---

Nick1
Nick2
Nick3
etc.

------ . ------
Here is the code of the tcl i wanna update:

Code: Select all

set chnnl "#chan" 
set ntwrk "NetworkNet"
set passwd "s0me_pass"

bind join - "$chnnl *" msg:join

proc msg:join {nick uhost handle channel msg} { 
  if {[strlwr $nick] != [strlwr $::botnick] } { 
   puthelp "PRIVMSG $nick :Hey $nick, you have unallowed ip, unwelcomed on $ntwrk, please part $chnnl or type '/msg $::botnick ALLOWED <password>' to stop being msged" 
  } 
}
So, this tcl should check the hosts.txt file and if in finds the hostmask, it should pm user with the text from the code. If they type 'ALLOWED s0me_pass" the bot should add their nick to te nicks.txt file and wont msg them anymore. Im a tcl n00b, especialy in managing files and help would be very appreciated. If its not too much from me to aks, a system that will check if the nick who joined gets @ by chanserv on $chnnl and automaticly add that nick to nicks.txt would be great, cause operators should be allowed to stay on $chnnl without any pm to leave.


tnx in advance,
all the best,
Mike
M
Mike N.

Post by Mike N. »

guys, i really need help. can someone help me? :roll:
M
Mike N.

Post by Mike N. »

please please please help me!
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Reading and parsing files each time a user joins a channel sounds like a bad idea to me.

How about making a user record for the masks that are not allowed?
It would sure save you some work.

just add a user, .chattr it -any default flags+some custom flag
and include that flag in your join bind.

For the allowed nicks I suggest using the user@host instead, as nicks change more often. make the "nicks.txt" contain a tcl array or list and just 'source' that file, then check against the array/list inside the proc before displaying the message.
M
Mike N.

Post by Mike N. »

user, your help on this thread is very appreciated by me.

thank you very much man!!!!!
Locked