My first script: Maxadv.ash

Been away from both KOL and Mafia for a while. Just put this together today to facilitate my folding my stinky cheese into a diaper, donning my best + Adv gear, and creating/using a wang on myself to prevent the sword from mucking up chat. It's a simple little thing but some others might find it useful. It does expect you to have a stinky cheese item and requires the use of FNNinja's wang alias or something similar. Here's the wang alias I use (created by FNNinja) to create and use a wang on yourself.

Code:
alias wang => ash retrieve_item(1,$item[wang]); string name; if("%%" == "") name = my_name(); else name = "%%"; string page = visit_url("curse.php?action=use&pwd&whichitem=625&targetplayer="+name);

Code:
[ATTACH]3720._xfImport[/ATTACH]
 

Bale

Minion
Code:
alias wang => ash retrieve_item(1,$item[wang]); string name; if("%%" == "") name = my_name(); else name = "%%"; string page = visit_url("curse.php?action=use&pwd&whichitem=625&targetplayer="+name);

That could be improved a trifle:

PHP:
alias wang => ashq if(can_interact()) {retrieve_item(1,$item[wang]); string name = $string[%%]; if(name == "") name = my_name();  cli_execute("throw 1 wang at "+name);} else print("Play with your wang when you're out of ronin.", "red");

  • I've run into parsing problems in the past using "%%" so now I prefer to use $string[%%] to deal with possible edge cases. Otherwise I run into bugs.
  • I also prefer to use mafia commands to visit_url() whenever a command is available, so I used throw.
  • I shortened the script a bit by initializing the value of name, rather than using an else command to set the default value.
  • Finally, I added a check to see if you're out of hardcore/ronin just in case you accidentally use it at the wrong time. I suppose you should remove that check if (unlike me) you don't mind using resources when the mall is unavailable.

As for your script, I'd build the wanging into the script rather than relying on an external alias. Though that's not a big deal. (And you'd need to use the visit_url to avoid being messed with by the alias.)
 
That could be improved a trifle:

PHP:
alias wang => ashq if(can_interact()) {retrieve_item(1,$item[wang]); string name = $string[%%]; if(name == "") name = my_name();  cli_execute("throw 1 wang at "+name);} else print("Play with your wang when you're out of ronin.", "red");

  • I've run into parsing problems in the past using "%%" so now I prefer to use $string[%%] to deal with possible edge cases. Otherwise I run into bugs.
  • I also prefer to use mafia commands to visit_url() whenever a command is available, so I used throw.
  • I shortened the script a bit by initializing the value of name, rather than using an else command to set the default value.
  • Finally, I added a check to see if you're out of hardcore/ronin just in case you accidentally use it at the wrong time. I suppose you should remove that check if (unlike me) you don't mind using resources when the mall is unavailable.

Hmm, I can see the value of a lot of that. Of course with the hardcore/ronin check it's a matter of preferring to use resources rather than muck up chat with the sword of inappropriate prepositions.

edit: The check for hardcore/ronin is this part
Code:
ashq if(can_interact())
right?

As for your script, I'd build the wanging into the script rather than relying on an external alias. Though that's not a big deal. (And you'd need to use the visit_url to avoid being messed with by the alias.)

Well, I'm still a bit noobish with the coding and it seemed simplest to call an alias I already had in place rather than trying to code making/buying a wang and using it directly into the script.
 
Last edited:

Bale

Minion
Yup. That's the part of the alias which checks for full kingdom access. Without that it'd look like this:

PHP:
alias wang => ashq retrieve_item(1,$item[wang]); string name = $string[%%]; if(name == "") name = my_name();  cli_execute("throw 1 wang at "+name);


Well, I'm still a bit noobish with the coding and it seemed simplest to call an alias I already had in place rather than trying to code making/buying a wang and using it directly into the script.

You already figured all that out for your wang alias:

PHP:
retrieve_item(1,$item[wang]); 
visit_url("curse.php?action=use&pwd&whichitem=625&targetplayer=");
 
Top