Easy Requests

As i'm new to this and i want some practice, please post some simple requests and i'll do my best to create them. This will help me and you. And best of all, ITS FREE!!!!
 

arrggg

Member
Okay... I need a script.
or three.
Named:
Trapper-L.ash
Trapper-C.ash
Trapper-A.ash

The will try to pull the ores I need from Hank's then prompt me that I got them.
if that fails then will put on my mineing gear(Pulling from hank's if need be), if I don't have it then adventure in the mine to get the mineing gear. After it puts it on it will prompt me to Go mining.

How's that for a script?
 
[quote author=arrggg link=topic=299.msg1584#msg1584 date=1153344353]
Okay... I need a script.
or three.

-- snip --

[/quote]

That is a nice one to start with. I was already formulating a way to write it when I realized that this was GhettoTruckers' thread to practice in. ;)

If you need a hint or two GT, just ask.
 
[quote author=arrggg link=topic=299.msg1584#msg1584 date=1153344353]
Okay... I need a script.
or three.
Named:
Trapper-L.ash
Trapper-C.ash
Trapper-A.ash

The will try to pull the ores I need from Hank's then prompt me that I got them.
if that fails then will put on my mineing gear(Pulling from hank's if need be), if I don't have it then adventure in the mine to get the mineing gear. After it puts it on it will prompt me to Go mining.

How's that for a script?
[/quote]

I'm kind of confused. Why do you need 3 scripts? And what is the perpose of this script? I'm kind of spaced out today so a few helpfull hints is always helpfull...LOL
 

Bishy

New member
[quote author=GhettoTrucker link=topic=299.msg1611#msg1611 date=1153418121]
I'm kind of confused. Why do you need 3 scripts? And what is the perpose of this script? I'm kind of spaced out today so a few helpfull hints is always helpfull...LOL
[/quote]
he wants one for farming asbestos ore, one for linoleum and one for chrome ore :)
 
[quote author=arrggg link=topic=299.msg1584#msg1584 date=1153344353]
Okay... I need a script.
or three.
Named:
Trapper-L.ash
Trapper-C.ash
Trapper-A.ash

The will try to pull the ores I need from Hank's then prompt me that I got them.
if that fails then will put on my mineing gear(Pulling from hank's if need be), if I don't have it then adventure in the mine to get the mineing gear. After it puts it on it will prompt me to Go mining.

How's that for a script?
[/quote]

Ok, so the way i see it you want:
(L)inolium Ore farm:
-Pull "L" ores from Hagnks.
-If Have (in hangks) STOP and Print "You Have "L" Ores"
-If NO Ores put on Mining gear (pull from Hangks if need be.)
-Adventure at Itznotyerzitz Mine for "L" Ores.

(C)hrome Ore farm:
-Pull "C" ores from Hagnks.
-If Have (in hangks) STOP and Print "You Have "C" Ores"
-If NO Ores put on Mining gear (pull from Hangks if need be.)
-Adventure at Itznotyerzitz Mine for "C" Ores.

(A)sbestos Ore farm:
-Pull "A" ores from Hagnks.
-If Have (in hangks) STOP and Print "You Have "A" Ores"
-If NO Ores put on Mining gear (pull from Hangks if need be.)
-Adventure at Itznotyerzitz Mine for "A" Ores.

Right? And you just want (1) of each ore right?
 

Nightmist

Member
[quote author=GhettoTrucker link=topic=299.msg1627#msg1627 date=1153440663]-snip-
[/quote]
Well I assume he means 3 ores based on the "Trapper" part of the request ;)

If you are going to script the actual adventuring of the mine to get ores then it might quickly become a little messy. Since theres no way to get ores by "normal" adventuring you will have to do some mining game research. Or ask ^^, it is quite do-able but he didn't ask for mining game script just that it prompt him to go mining afterwards.

In my thoughts I think the request was:
"Try pull 3 of X ore from storage. If success then print that it was a success otherwise pull mining gear if in storage else adventure for mining gear and then stop and print something about Going Mining and then stop." X being one of the 3 ores mentioned.

Just thoughts though :D
 
OK, in that case it should be fairly simple. I understand what he is asking now. Here is the rough draft of what i have.

Code:
 -Pull 3 X ores from Hangks
 -If successful print "The Ores were found."
 -If none found put on mining gear
 -If no mining gear in inventory pull from Hangks
 -Then print "No ores were found in storage, but you're ready to mine."

Look good? its almost done! I think.
 

macman104

Member
One quick thing to check was that if there wasn't all of the mining gear found, then you need to adventure for it.
 

arrggg

Member
[quote author=GhettoTrucker link=topic=299.msg1635#msg1635 date=1153456473]
OK, in that case it should be fairly simple. I understand what he is asking now. Here is the rough draft of what i have.

Code:
 -Pull 3 X ores from Hangks
 -If successful print "The Ores were found."
 -If none found put on mining gear
 -If no mining gear in inventory pull from Hangks
 [b]-If not in Hangks then try to adventure for it[/b]
 -Then print "No ores were found in storage, but you're ready to mine."

Look good? its almost done! I think.
[/quote]

yep that's what i want.
 
[quote author=macman104 link=topic=299.msg1636#msg1636 date=1153456674]
One quick thing to check was that if there wasn't all of the mining gear found, then you need to adventure for it.
[/quote]

Well, thats kind of hard to code i would think because of the new mining format. So i guess i would jusyt have it post a message that says, "gotta get the gear!" or something. Also i have to go on a last minute trip so i'll be out for a few days. But i'll post the script ASAP.
 
Ok, so i had a little bit of down time before i left so here is what i have so far. Its mostly done (if i did it right) so coders look ot over and critique it while i'm gone.

Code:
void main()

	cli_execute("hagnk 3 chrome ore";
		{
	if(hangk_amount(chrome ore) =3)
	cli_execute("echo 3 chrome ores were found!");
	}	
		{	
	if(hangk_amount(chrome ore) >3) 
	cli_execute("hangk 1 miner's helmet, 1 7-Foot Dwarven mattock, 1 miner's pants");
	cli_execute("outfit mining gear");
	}
		{
	if(hangk_amount(miner's helmet, 7-foot Dwarven mattok, miner's pants) >1)
	cli_execute("echo Almost ready");
	}
		{
	repeat
	cli_execute("adventure * Itznotyerzitz Mine")
	until (item_amount(miner's helmet, 7-Foot Dwarven mattock, miner's pants) =1)
	}
		{
	<WHEN EVERYTHING =TRUE>
	cli_execute("echo No Ores were found but you're ready to mine!");
	}

The last part
Code:
{
	<WHEN EVERYTHING =TRUE>
	cli_execute("echo No Ores were found but you're ready to mine!");
	}
I'm not sure how to do that. Or how to make it work. so please do post ideas on that!
 

Nightmist

Member
[quote author=arrggg link=topic=299.msg1643#msg1643 date=1153505665]
Nope... if you don't have the gear, it's just like all the other places to adventure...
[/quote]
A few things to remember:
If you really want to get into the script then remember to "set" the choice adventures to finish the outfit instead of relying on the item dropping.


As a tip you might want to consider putting the different ore commands into a single "boolean GetOre( item OreType)". Although thats going to start getting alot more technical then what your wanting to do and is sort of pointless since its going to be split into different scripts apart from ease of editing at some later date.
Oh and your curly braces are mostly un-needed(Or in the wrong place), you missed one just under "void main()".
"cli_execute( "echo stuff");" has a ASH command, "print( "stuff");"
The "=3" should be a ">3" and instead of a double if you can try using a "else" (You will need the curly braces to do this I think though.)
 
[quote author=Nightmist link=topic=299.msg1650#msg1650 date=1153531808]
A few things to remember:
If you really want to get into the script then remember to "set" the choice adventures to finish the outfit instead of relying on the item dropping.


As a tip you might want to consider putting the different ore commands into a single "boolean GetOre( item OreType)". Although thats going to start getting alot more technical then what your wanting to do and is sort of pointless since its going to be split into different scripts apart from ease of editing at some later date.
Oh and your curly braces are mostly un-needed(Or in the wrong place), you missed one just under "void main()".
"cli_execute( "echo stuff");" has a ASH command, "print( "stuff");"
The "=3" should be a ">3" and instead of a double if you can try using a "else" (You will need the curly braces to do this I think though.)
[/quote]

So is this better?
Code:
void main()
{
cli_execute("hagnk 3 chrome ore";
{
if(hangk_amount(chrome ore) >3)
cli_execute("echo 3 chrome ores were found!");
}
{
if(hangk_amount(chrome ore) >3)
cli_execute("hangk 1 miner's helmet, 1 7-Foot Dwarven mattock, 1 miner's pants");
cli_execute("outfit mining gear");
}
{
if(hangk_amount(miner's helmet, 7-foot Dwarven mattok, miner's pants) >1)
cli_execute("echo Almost ready");
}
{
repeat
cli_execute("adventure * Itznotyerzitz Mine")
until (item_amount(miner's helmet, 7-Foot Dwarven mattock, miner's pants) =1)
}
{
<WHEN EVERYTHING =TRUE>
{
print("Ready!");
}

Post what you think would work better too. Also how do i make the
Code:
{
<WHEN EVERYTHING =TRUE>
{
print("Ready!");
work?


EDIT:
Code:
void main()
		{
	cli_execute("hagnk 3 chrome ore");
		{
	if(hangk_amount(chrome ore) >3)
	cli_execute("echo 3 chrome ores were found!");
	}	
		{	
	if(hangk_amount(chrome ore) <3) 
	cli_execute("hangk 1 miner's helmet, 1 7-Foot Dwarven mattock, 1 miner's pants");
	cli_execute("outfit mining gear");
	}
		{
	if(hangk_amount(miner's helmet, 7-foot Dwarven mattok, miner's pants) <1)
		{
	repeat
	cli_execute("adventure * Itznotyerzitz Mine")
	until (item_amount(miner's helmet, 7-Foot Dwarven mattock, miner's pants) =1)
	}
	}
		{
	<WHEN EVERYTHING =TRUE>
	print("echo No Ores were found but you're ready to mine!");
	}

Ok, so when do you use the "{" and "}" symbols? I was under the impression that you used them before and after each boolean...And also should i be using void main() or something else? Do i even need void main()?
 

Nightmist

Member
[quote author=GhettoTrucker link=topic=299.msg1661#msg1661 date=1153753526]
Ok, so when do you use the "{" and "}" symbols? I was under the impression that you used them before and after each boolean...And also should i be using void main() or something else? Do i even need void main()?
[/quote]

Example use of "{" and "}"
Code:
if( true)
{
 print("A code block that extends");
 print("for more then the 1 line");
 print("directly under the if.");
}
In other words you use them to define "How much of the below code to use when the check in the flow control returns true".

The "void main()" arguement is really dependant on the person (and the script), in this case no you dont need it although as scripts become more complex and you start having your own little functions then the "void main()" becomes more important.


Fear my really bad explaining of stuff >>. Oh and your missing a few ";" in that script.
 

macman104

Member
[quote author=GhettoTrucker link=topic=299.msg1672#msg1672 date=1153852426]
Ok, now i see... I got a lot of cleaning up to do now....
[/quote]heh, it's cool. One thing I've been meaning to mention, but haven't gotten around to, is that, you seem to be pulling the items from hagnk's before you check to see if you have them. Ideally, you'd run your check
Code:
if(hangk_amount(chrome ore) >= 3)
then if true, withdraw the items. Right now, that check will always return false unless you have 7 or more of the ore, because you withdraw three, then check to see if you have more than 3. You should be checking, then withdrawing.
 
Top