A Fruity Friend Script

codster62

Member
Howdy, I am looking for a script that will spend all adventures farming for fruit at the lemon party slot, then send all of the Cherries, Limes, and Jumbo Olives to my friend moon98!

Thanks, and I could probably do this myself, but I am lazy. ;)
 

codster62

Member
Drained out of you? Oh well. I have decided to do this script myself anyways. I am bored. XD I should have it done today for anybody who wants to use it.
 

Grotfang

Developer
Asking for a script simply because you are too lazy to write it yourself comes across quite poorly, codster.

Nonetheless, I was bored, so here you go. It will only send off limes, jumbo olives and cherries, as requested (not oranges and lemons) and it isn't set specifically to send to moon98 - when it is called it asks who your desired recipient is.

As well as all this, it won't automatically spend all of your adventures doing this. When you call the script the first pop up you will see asks you for an integer for adventures to use. If you leave this blank, type in 0 or give a number greater than your adventures it will spend all your adventures. However, it does give you the choice to spend significantly fewer than your total adventures in there, if you want to save some for rollover (aren't I friendly? :) )

In addition, I thought it prudent to get the script to check for any ten-leaf clovers in your inventory before starting, so you can confirm that you want to burn through them if they are present, or stop it before things get nasty. It will also check before adventuring whether you want to closet any fruits you have in your inventory, so as to only send those items you get while adventuring, if you so desire.

Enjoy.
 

Attachments

  • lemonparty.ash
    2.5 KB · Views: 64
Last edited:

codster62

Member
Wow, once again, thanks. I was trying to do this myself, but since I had some problems, aI am going to have to look to see what you did so I can see what I was doing wrong... I am trying to learn here, so please be patient if I am a little lazy/busy. Hehe.

EDIT: Well, after looking at the script a bit, I have a question. Usually, my mind is stuck on other programming languages, so when I see the "if" statement in .ash, I kind of get confused. Usually in Basic and other programming, whenever you have the if statement, the "then" statement follows... In your script when you use the "if" statement, how do you declare what happens if the appropriate conditions are met? I am not seeing the "then" statement... Also, does the "and" "or" statements/functions/whatever the heck they are called work in .ash, or is it different as well?
 
Last edited:

Bale

Minion
Just assume there is an invisible "then" at the end of the condition. You couldn't possibly have an if without a then after all. Everything inside the parenthesis is the condition, after the condition is then. Else is optional and will be declared.

boolean conditionals:
and: &&
or: ||
not: !
 

Camber

Member
Also, everything in the 'then' section of an IF statement will be in { }, although with just a single line, the { } may be eliminated.

Code:
if ( item_amount( it ) != 0 ) 
	print("Inventory: " + item_amount( it ) ) ;
 

codster62

Member
Wow, thanks for the tips! Not this is more like visual Basic than I though. :) I think a lightbulb just kind of clicked off in my head. You guys/gals rock!
 

Grotfang

Developer
What I like to do to highlight my "then" statements is to always contain my "actions" within {}

So for me, my code will always have:

Code:
if( condition )
{
       statement
}

Even if it is not entirely necessary. I.E. as Camber says, single line statements do not need to be contained within {}, I just prefer the visual look of it - makes it easier for me to see how the code flows.
 

codster62

Member
Yes this makes since. =) I am sorry bout my lack of enthusiasm lately... School starts in two days, and I have been busy! However, you people telling me these facts has peaked my interest a bit. :) I will definately be studying more script...
 
Top