Bug - Fixed visit_url problems

QVamp

Member
I was running a test to find out how to link items to the wiki, and I ran into 2 problems with visit_url. One may be due to the page being returned, the other is just... odd.

If you run the following command (command line or in script)
Code:
ash string x = visit_url('http://kol.coldfront.net/thekolwiki/index.php/Prelude_of_Precision');

Mafia spits out:
Code:
You learned a new skill: <a href="/thekolwiki/index.php/Prelude_of_Precision_(skill)" title="Prelude of Precision (skill)">Prelude of Precision</a>

I'm assuming something internally is parsing the string without my sayso, and it is listing this message because of page content:

Code:
<p>You acquire a skill: <b><a href="/thekolwiki/index.php/Prelude_of_Precision_(skill)" title="Prelude of Precision (skill)">Prelude of Precision</a></b>
</p>


Next, stranger... any item I try to look up that has the letters 'mall' in it fails to return anything.

Code:
ash string x = visit_url('http://kol.coldfront.net/thekolwiki/index.php/Large_box');

works

Code:
ash string x = visit_url('http://kol.coldfront.net/thekolwiki/index.php/Small_box');

does not. I've verified this with every item that has the name 'mall' in it (and items with 'all' or 'mal' work just fine.

I'm assuming it is another internal parse issue, but in this case, I don't know what to look for.

Anything I'm doing wrong? Or any suggestions to get around this?
 

Winterbay

Active member
I think the latter is a part of the mallbot protection scheme in which URLs that lead to the Mall are disallowed in visit_url. It's a bit interesting that it matches on "small" though but as I have no idea on the internal workings of that code I don't know if that is intentional or just an oversight :)

For the first one it might be good to look at the versions of visit_url with more parameters than one, allthough I'm not sure if that will help because I don't really understand what they do :)
 

lostcalpolydude

Developer
Staff member
Changing the mallbot protection to look for mall.php and maybe mallstore.php seems like it would eliminate the issue while preserving the intended function. Maybe even searching for "mall" and "php", though that still leaves room for plenty of false positives.
 

QVamp

Member
Luckily my script grouped everything together. I noticed that every Small showed up, and that every marshmallow showed up. But I didn't even think about the fact that 'flamingo mallet' had a mall in it.

For this problem, I would also turn off protection if there is a server, and the server isn't one of the kol servers.

In terms of the first problem, I don't think extra parameters would help. I believe get/post are ways to send the request, they both still return a string in the same way. Encoded/not states whether the URL has to be changed. In these cases, it they are all acceptable URL strings, so nothing to encode... and again, only changes the sending, not the receiving.

I tried using a buffer instead of a string, but no change. It *looks* like the visit_url itself causes the problem, not assigning the output to a variable.
 

roippi

Developer
I won't copy/paste the relevant code, but it does look like mafia looks for indexOf( "mall" ) to decide if it should allow the url request.
 

Theraze

Active member
Guessing that your bug with parsing wiki-pages being considered to buy skills is why manually purchasing skills with visit_url double-decrements your meat as well...
 

Bale

Minion
It seems hola has made two commits to fix this issue. (r9721 & r9722) Could you confirm that it works properly now in r9722?
 
Top