mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
here is the script i am using


on *:text:*:?:{
/msg $nick Hi $nick Example Our System Will Repsond In One Minute
timer 1 60 /msg $nick $read randomtimer.txt }

in a pm
what i want to do is
2 text files
text.txt
randomtimer.txt
see the wildcard * i want to create a .txt file if someone types information correct
in this text file on the on text:
they will get the message & the response from randomtimer.txt in 60 seconds

if they dont it will do nothing


can someone help me please

i have been looking around and i think it will be something like

if $read iswm== text.txt but as i am a complete noob and am not understanding what these are doing if its even right

hope someone can help

best regards
wayne

Joined: Jul 2006
Posts: 4,152
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,152
You are not very clear, but from what you said, there's two text files "text.txt" and "randomtimer.txt".
text.txt will contain some wildcard like *test*, and if an user says something that matches, send a message to them with a timer with a random line from the file randomtimer.txt?

If that's what you want, instead of text.txt, a better method is to use an hash table, which is similar but offers a good way of matching in your case:

Code:
on *:start:.hmake text | if ($exists(text)) .hload text text
on *:exit:hsave text text
on *:text:*:?:if ($hfind(text,$strip($1-),1,W).data) { .timer 1 60 msg $nick $!read(randomtimer.txt,nt) | msg $nick $1- our system will reply in 60 seconds 
}

now instead of adding line to text.txt with something like *text* you add it to the hash table with /hadd -m text N *text* where N is a number acting as a counter (start with 1), but it can litteraly be anything that doesn't contain a space, is different from $false and 0.
The file randomtimer.txt must be in your $mircdir.

Last edited by Wims; 02/04/12 05:28 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
thanks for your reply i will try and explain better

inside a private message

say a user types

helloworld and its inside text file 1 inside my mirc

it will then reply with a message, helloworld our system will reply in 60 seconds

in 60 seconds it will reply with a random text entry from my randomtext.txt file in my mirc

i hope this is explained a bit better


Joined: Jul 2006
Posts: 4,152
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,152
Yeah, well try the code, it should work.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
hi, i will give your method a try, again thanks so much, yous guys are amazing smile

Thanks Wayne

Last edited by wrt12345; 02/04/12 05:33 PM.
Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
hey guys

where do i find this hash table,as i need to input data into it

this is why i thought a .txt file would be better ?

Best Regards
Wayne



Joined: Jul 2006
Posts: 4,152
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,152
The code will manage the table for you once it exists.
The table doesn't exist at first so you must create it before adding something to it; however the -m switch in /hadd create the table if it doesn't exist so just use that.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
i created a hash file but i cant find it anywhere ????

look all through out mirc

Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
i need to be able to edit like a text file as it will change from day to day


best regards
wayne

Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
its okay found it lol

Thanks For Everything Guys

Wayne

Joined: Apr 2012
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Apr 2012
Posts: 11
right so i need three of these now

i have tried this but dont work

on *:start:.hmake text | if ($exists(text)) .hload text text
on *:exit:hsave text text
on *:start:.hmake text1 | if ($exists(text1)) .hload text1 text1
on *:exit:hsave text1 text1
on *:start:.hmake text2 | if ($exists(text2)) .hload text2 text2
on *:exit:hsave text2 text2
on *:text:*:?:if ($hfind(text,$strip($1-),1,W).data) { .timer 1 60 msg $nick $!read(randomtext1.txt,nt) | msg $nick $1- our system will reply in 60 seconds
on *:text:*:?:if ($hfind(text1,$strip($1-),1,W).data) { .timer 1 60 msg $nick $!read(randomtext2.txt,nt) | msg $nick $1- our system will reply in 60 seconds
on *:text:*:?:if ($hfind(text2,$strip($1-),1,W).data) { .timer 1 60 msg $nick $!read(randomtext3.txt,nt) | msg $nick $1- our system will reply in 60 seconds
}


is there away to load from one line ?

again thanks wayne


Link Copied to Clipboard