Ok, let me try a different approach to my problem, beings i can't seem to get anyone to give a bit of script to play with in my last topic. then I will make an attempt at tcl from there, which I'm not very comfortable doing. I even hire a coder if I could find one. Come on guys I know someone knows how to do this.
so here goes
how do I put a host mask into a file on the shell and then when someone does !stocklist it see's if the users host mask is in the file?
Put your hostmasks into a file with a text editor.
Make a bind for the !stocklist command with the "bind" command, probably with the "pub" binding. Check the tcl-commands.doc that comes with eggdrop.
To see if the user's hostmask is in the file, open up the file ("open"), read it ("read", "split"), close the file ("close"), and search the results ("foreach", "string match"). Check the tcl manual at http://www.tcl.tk/man/tcl8.4/TclCmd/contents.htm for info on each command.
Now you have pretty much all the commands you need, as well as the order they go in.
Example of defining a proc: proc something {a b c} { # your code here }
Example of opening a file: set fp [open file]
Example of reading the lines: set lines [split [read -nonewline $fp] "\n"]
Example of closing a file: close $fp
Example of foreach: foreach element $somelist { putlog $element }
Example of if statement: if {2 == 2} { putlog "true!" } { putlog "false!" }
Example of string matching: set matches [string match "sheep*" "sheep are sexy"]
Stdragon I appreciate your help, but hell I don't even know how to start to put that into tcl format, when I ask for an example I meant something in code. Is there any script or similiar script around that someone has done this, I would think something simiar to this has happened or needed before.
stockman wrote: Stdragon I appreciate your help, but hell I don't even know how to start to put that into tcl format, when I ask for an example I meant something in code. Is there any script or similiar script around that someone has done this, I would think something simiar to this has happened or needed before.
Thanks for your help, I know you were trying to help me , but as I said before,I"m just not a coder, I tried it and screwed more things up than I fixed anything. Some people are not born to do this stuff and some are, I just happen to be one thats not, I'm good in a lot of other things but I flunked this one.
I finally found someone to code it for me. not from here.