I understand that people are trying to spade where the invisible string comes from and want to script it using /count, since it just appears in inventory ... sometimes ... with no announcement.
Seems like this could do it. For amusement, I also coded a more general function:
1) I separated out the command and parameters so that we can filter based on command, if we wish. For example, we don't want to allow scripts to spam people, so we could disallow "msg", say. I'm not sure if we disallow that in the CLI.
2) The function returns the raw response, complete with HTML formatting. That's why all those responses are green: they are wrapped in "font" tags which make them green.
3) Notice how the "/equip" command works: it sends back a green message saying "Equipping ITEM", but also a javascript comment to actually do the equip. Both the browser chat client and KoLmafia chat (including "/" commands in the gCLI) dutifully submit the URL. This command does not; it returns to the script exactly what it got from KoL, so when I submitted an "equip" command, it didn't really change my equipment.
4) Notice how using "pull" (or "closet or "uncloset") can be learned to discover plurals.
Should I submit this? Are there any commands we should disallow?
Code:
[color=green]> ash slash_count( $item[ sugar sheet ] )[/color]
Returned: 2391
[color=green]> ash slash_count( $item[ invisible string ] )[/color]
Returned: 0
Code:
[color=green]> ash slash_command( "whois", "Jick" )[/color]
Returned: [color=green]Jick (#1), Jick-Or-Treat! (In Ronin)[/color]
[color=green]> ash slash_command( "count", "sugar sheet" )[/color]
Returned: [color=green]You have 2391 sugar sheets.[/color]
[color=green]> ash slash_command( "pull", "100 lump of not really wriggling eldritch matter" )[/color]
Returned: [color=green]Hagnk's doesn't have that many of your lumps of not really wriggling eldritch matter, he's only got 3.[/color]
[color=green]> ash slash_command( "equip", "pants Pantsgiving" )[/color]
Returned: [color=green]Equipping Pantsgiving.[/color]
[color=green]> ash entity_encode( slash_command( "equip", "pants Pantsgiving" ) )[/color]
Returned: <font color=green>Equipping Pantsgiving.<!--js(dojax('inv_equip.php?action=equip&whichitem=6860&ajax=1&pwd=xxxx');)--></font><br>
2) The function returns the raw response, complete with HTML formatting. That's why all those responses are green: they are wrapped in "font" tags which make them green.
3) Notice how the "/equip" command works: it sends back a green message saying "Equipping ITEM", but also a javascript comment to actually do the equip. Both the browser chat client and KoLmafia chat (including "/" commands in the gCLI) dutifully submit the URL. This command does not; it returns to the script exactly what it got from KoL, so when I submitted an "equip" command, it didn't really change my equipment.
4) Notice how using "pull" (or "closet or "uncloset") can be learned to discover plurals.
Should I submit this? Are there any commands we should disallow?
Last edited: