|
bwuser
|
bwuser
|
DaveC gave me this great script. problem is after minor changes it stopped working. please someone tell me where i went wrong
alias isin.match.txt {
if ($isfile($+($scriptdir,match.txt))) {
if (($file($+($scriptdir,match.txt)).mtime != %match.txt.file.mtime) || (!$hget(match.txt))) {
set -se %match.txt.file.mtime $file($+($scriptdir,match.txt)).mtime
hfree -w match.txt
hmake match.txt
hload -n match.txt match.txt
}
var %c = 1 | while (%c <= $numtok($1,46)) {
if ($hfind(match.txt,$gettok($1,$+(1-,%c),46)).data) { return $v1 }
inc %c
}
}
}
this one Doesn't work
alias sports.match {
if ($isfile($+($mircdir,TVCheck\sports.txt))) {
if (($file($+($mircdir,TVCheck\sports.txt)).mtime != %sports.txt.file.mtime) || (!$hget(sports.txt))) {
set -se %sports.txt.file.mtime $file($+($mircdir,TVCheck\sports.txt)).mtime
hfree -w sports.txt
hmake sports.txt
hload -n sports.txt sports.txt
}
var %c = 1 | while (%c <= $numtok($1,46)) {
if ($hfind(sports.txt,$gettok($1,$+(1-,%c),46)).data) { return $v1 }
inc %c
}
}
}
offcourse the txt's exist in the places specified i dont know whats wrong 
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
DaveC gave me this great script. problem is after minor changes it stopped working. please someone tell me where i went wrong
alias isin.match.txt {
if ($isfile($+($scriptdir,match.txt))) {
if (($file($+($scriptdir,match.txt)).mtime != %match.txt.file.mtime) || (!$hget(match.txt))) {
set -se %match.txt.file.mtime $file($+($scriptdir,match.txt)).mtime
hfree -w match.txt
hmake match.txt
hload -n match.txt match.txt
}
var %c = 1 | while (%c <= $numtok($1,46)) {
if ($hfind(match.txt,$gettok($1,$+(1-,%c),46)).data) { return $v1 }
inc %c
}
}
}
this one Doesn't work
alias sports.match {
if ($isfile($+($mircdir,TVCheck\sports.txt))) {
if ($file($+($mircdir,TVCheck\sports.txt)).mtime != %sports.txt.file.mtime) || (!$hget(sports.txt)) {
set -se %sports.txt.file.mtime $file($+($mircdir,TVCheck\sports.txt)).mtime
hfree -w sports.txt
hmake sports.txt
hload -n sports.txt [color:red]$qt($mircdirTVCheck\sports.txt)[/color]
}
var %c = 1 | while (%c <= $numtok($1,46)) {
if ($hfind(sports.txt,$gettok($1,$+(1-,%c),46)).data) { return $v1 }
inc %c
}
}
}
offcourse the txt's exist in the places specified i dont know whats wrong Edited in red I saw something wrong too is that the HLOAD was not assigned to target location sports.txt didnt exist in the mircdir so you have to assign its path youll see what I meat i also put $qt(command) incase of spaces if it still doesnt work use $+(",command,")
Last edited by Lpfix5; 16/10/06 11:09 PM.
|
|
|
|
bwuser
|
bwuser
|
still not working when trying to use it with this:
ON 1: TEXT:*:# {
if ($nick isin %test) {
set %testnick $nick
set %testitem $strip($1-)
;[New TV]
if (classification isin %testitem) {
set %tv $strip($dotdash($right(%rls,-15)))
if ($read($shortfn($mircdirTVCheck\check.txt),w,$allcut(%tv))) { echo testcheck works }
elseif ($read($shortfn($mircdirTVCheck\check2.txt),w,$allcut(%tv))) { echo testcheck2 works }
elseif ($isin.sports.match(%tv)) { testcheck3 works }
}
unset %testnick
unset %testitem
}
else {
halt
}
}
testcheck 1 and 2 work fine (for those i use regex) but i was using it to show that it wasnt the detection script it must be in the code i need fixing 
Last edited by bwuser; 16/10/06 11:22 PM.
|
|
|
|
DaveC
|
DaveC
|
good catch, i never noticed it becuase i ran it from the mirc folder anyway, so scriptdir matched to just using match.txt on its own. oppps!
|
|
|
|
bwuser
|
bwuser
|
it's still not working though DaveC any suggestions? it works great from $scriptdir
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
good catch, i never noticed it becuase i ran it from the mirc folder anyway, so scriptdir matched to just using match.txt on its own. oppps! Yup, the problem I have with $scriptdir is its called from the well exactly how the eval is called scriptdir it detects the dir where your script is so for example if TXT file isin C:\program files\mirc\txt\hi.txt and your script you saved it in C:\program files\mIRC\system\scripts\myscript.mrc your path $scriptdir wont work for him unless script isin root but then the next problem is if you use $mIRCdir for example you might often have space issues in your path. Nothing $qt or $+(",command,") can't fix but you can be spending hours trying to figure out when your new to scripting why its not working when everything is perfect by the book,. So just a note to new users wrap your path in quotes using either $+(",PATH,") or $qt(path)
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
it's still not working though DaveC any suggestions? it works great from $scriptdir Are you sure? because your code is correct syntax just a small little issue in the target location like i mentioned if its not working remove $qt($mircdirTVCheck\sports.txt) and use $+(",$mircdirTVCheck\sports.txt,")
|
|
|
|
bwuser
|
bwuser
|
my mircdir is c:\mIRC-X\ can you please paste the code which i should use now? im a bit lost and still dont have it working in my \TVCheck\ dir
|
|
|
|
bwuser
|
bwuser
|
nope not working
Last edited by bwuser; 16/10/06 11:37 PM.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
alias sports.match {
if ($isfile($mircdirTVCheck\sports.txt)) {
if ($file($mircdirTVCheck\sports.txt).mtime != %match.txt.file.mtime) || (!$hget(sports.txt)) {
set -se %match.txt.file.mtime $file($mircdirTVCheck\sports.txt).mtime
hfree -w sports.txt
hmake sports.txt
hload -n sports.txt $qt($mircdirTVCheck\sports.txt)
}
var %c = 1 | while (%c <= $numtok($1,46)) {
if ($hfind(sports.txt,$gettok($1,$+(1-,%c),46)).data) { return $v1 }
inc %c
}
}
} try that code was somethings i edited when i started with the script which didnt need too but they are there... in exact working condition.. so ... therefore it should work if the original one was working for you.. make sure your .txt file in tvcheck is sports.txt not sport.txt and to make sure your path is correct type //echo -a $exists($mircdirTVCheck\sports.txt) if that returns $true it means it exists otherwise its false.
|
|
|
|
bwuser
|
bwuser
|
it replies $true but still not working 
|
|
|
|
DaveC
|
DaveC
|
go back to the original script (the one that didnt work right you posted)
and replace this line hload -n sports.txt sports.txt with this line hload -n sports.txt $qt($+($mircdir,TVCheck\sports.txt))
And then make sure the same sports.txt that was in he mirc folder is now in the TVCHECK folder
beyond that i cant see what it can be
PS: to anyone who cares, yes i know $mircdir can live with text appened to the end, its just i find the idea that SOME identifiers allow it and others dont, distrubing, so i dont ever attach to them at all!
|
|
|
|
bwuser
|
bwuser
|
nope  guess i will have to run it from mirc dir
|
|
|
|
bwuser
|
bwuser
|
did you guys get it working on your own mirc?
Last edited by bwuser; 17/10/06 12:27 AM.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
did you guys get it working on your own mirc? Yes I have DaveC p.s why are you using $+($mircdir,TVCheck\sports.txt) ? lol jk :P
|
|
|
|
DaveC
|
DaveC
|
alias sports.match {
if ($isfile($+($mircdir,TVCheck\sports.txt))) {
if (($file($+($mircdir,TVCheck\sports.txt)).mtime != %sports.txt.file.mtime) || (!$hget(sports.txt))) {
set -e %sports.txt.file.mtime $file($+($mircdir,TVCheck\sports.txt)).mtime
hfree -w sports.txt
hmake sports.txt
hload -n sports.txt $qt($+($mircdir,TVCheck\sports.txt))
}
var %c = 1 | while (%c <= $numtok($1,46)) {
if ($hfind(sports.txt,$gettok($1,$+(1-,%c),46)).data) { return $v1 }
inc %c
}
}
} Now the only thing i changed (which didnt effect it anyway) was the 4th line i removed the -s switch which displayed the value being set (this i accidently left in from when i was testing the script) The only reason your might not be working is you might still be using the old one, Its now $ sports.match($1-) returning $null for no match or N for matched line number. I have tested this and it functions as expected.
|
|
|
|
|