ID:141545
 
I have this code:

proc/Check_URL(Text,File)
if(File&&File["CONTENT"])
if(Text in file2text(File["CONTENT"]))
return 1


Its supposed to find whatever text you enter, at whatever URL you enter, and if it finds it, it returns true.

You use it like this:
if(Check_URL(src.key,"http://whatever.com"))
src<<"AAAAAAAAAAURRRRRRRRRRGHGHGHGHGHGHGHGHGHGHGHGHGH"

If a text file is located at whatever.com, it should return true.

The problem? It doesn't.

Why doesn't this code work? The file is there at the specified URL.

Thanks for any help.

I don't see you calling world.Export() for that address and obtaining the file :/

Just specifying the website address means nothing. You are telling DM "Here you go, make the File argument this string (insert address). Oh, don't do anything to it, just make it hold the string mkay?"
In response to GhostAnime
Oh. Yea strange how something like that can skip my mind.

So then why does this still not work?:

mob/verb/Test() //This verb is just supposed to use the Check_URL proc to find the user's key at the specified URL
if(Check_URL(key,world.Export("http://www.byond.com/members/Dragonn/files/Package%201.txt")))
src<<"Your key was found in the file" //The if() proc above returns false so it never gets to here
proc/Check_URL(Text,File) //This is the proc that needs looked at.
if(File&&File["CONTENT"]) //This returns true
world<<file2text(File["CONTENT"]) //This shows me the text it found in the file, and it does indeed show what is in the textfile
if(findtext(Text,file2text(File["CONTENT"]))) //This returns false though! Why?
return 1


You can copy this code as is, and use the verb, and you would see that it shows the text "Dragonn" and "Fusioneko" in the file, but when I try to find my key (which is Dragonn" it acts like it doesn't find it! Why?

[edit] ...Eh. Ok such a simple mistake, I put the parameters of findtext() on the WRONG ends! =P It's always the simple typos and mistakes that get me confused for a long time. I thought it was "findtext(Needle,Haystack)" but really its "findtext(Haystack,Needle)"