counting invisible strings

ungawa

Member
So with this week's podcast confirming the invisible string is the first step of a puzzle, I finally got around to working on a script to count invisible strings to try to pinpoint exactly when one appeared in my inventory if I ever get one.
So far, I added this to my pre-adventure script and checked the "run betweenBattleScript before manual adventures" preference:
Code:
cli_execute("refresh inv"); 
print("Invisible String count: " + item_amount( $item[invisible string] ) ); 
if (item_amount( $item[invisible string] ) > 0) { abort("You found an invisible string"); }

I guess my question would be, how taxing on the servers is a "refresh inv"? Is refreshing inventory every combat significantly worse than, say, taking one more round every combat if one were playing manually?
Is there a more elegant solution that would be less taxing on the servers?
As it is, I hesitate to share this in the G-D invisible string thread for the sake of the servers, but I'm not sure how we're going to make progress without more people running something like this.
 

Veracity

Developer
Staff member
It's a single ApiRequest. KoL has to build a JSON list with all of your item ids and counts. That's probably not cheap, but I doubt it is egregiously horrible.
 

Bale

Minion
Frankly, I doubt that this is a productive effort.

Invisible string vanishes at the end of the day, so it can be absolutely sure that it doesn't survive after rollover. I once found invisible string in my inventory immediately after my first logon of the day. (My login script prints a red message telling me if I have string in inventory so that I won't miss it.) That string must not have been in my inventory before rollover for obvious reasons.

Since I had string before doing anything, that means it appeared at login and must have been there as a result of something I did yesterday. Refreshing inventory after each adventure is a waste of server hits. It won't be there until tomorrow if you do something today.
 

lostcalpolydude

Developer
Staff member
I once found invisible string in my inventory immediately after my first logon of the day.

It sounds like you have assumed that this will always be true if one shows up at all. That isn't necessarily the case. (I don't have any special knowledge about how they work.)
 

ungawa

Member
I once found invisible string in my inventory immediately after my first logon of the day.

Ah, interesting. I'd heard that possibility as part of the rumor mill, but no one I was talking with at the time could quote a source. Good to know.
 

Bale

Minion
It's because of the rumor that I added it to my loginScript to check. Fortunately I can confirm the rumor. Found that string before even a single turn was played. My guess is that it appeared when I hit main.php since it does login things, but that's just a guess.

lost is right that my experience might not be the only one, but I think there's a good chance of it since an item appearing before playing turns is a very special mechanic.
 

heeheehee

Developer
Staff member
Chat has /count, which could be relevant, but there's no way to get a return value from that (visit_url bans submitnewchat.php, IIRC). That might be more efficient (I have no idea how the game implements these things) -- if nothing else, it'd be less network overhead.
 

ungawa

Member
Yea, I was talking with lost in chat before posting here and trying to see if there was already a way to parse the return from /count, but he thought it seemed there wasn't.
 

Theraze

Active member
Well, and you're comparing 1 api server hit against 1 chat server hit. So no hit-benefit there, though there may be some byte savings.
 

Veracity

Developer
Staff member
Except KoL's work to convert the entire inventory to JSON is probably more compute/DB intensive than looking up a single item in the inventory DB.
 

Theraze

Active member
Was mostly suggesting that this was unlikely to lead to a change in visit_url blocking behaviours, since it doesn't meet directly reducing KoL server hits, only saves some byte traffic and CPU cycles.
 

heeheehee

Developer
Staff member
Not all server hits are created equal. The entire point of reducing KoL server hits is to reduce the load on the KoL servers, whether it be in terms of CPU, network, RAM, DB, whatever. It's just always been that the number of server hits has been a "good enough" proxy on server load, and eliminating unnecessary server hits indisputably reduces overall server load.

Using number of server hits as the only metric of server load, though, is a poor metric.
 

lostcalpolydude

Developer
Staff member
For people still interested in invisible string, this post indicates that it comes from a plaid ghost. After reading that post, I was able to quickly pick one up myself.
 
Top