PDA

View Full Version : Easy Requests



GhettoTrucker
07-19-2006, 06:46 PM
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
07-19-2006, 09:25 PM
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?

Presto Ragu
07-20-2006, 05:37 AM
Okay... I need a script.
or three.

-- snip --



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.

GhettoTrucker
07-20-2006, 05:55 PM
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?


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
07-20-2006, 06:25 PM
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

he wants one for farming asbestos ore, one for linoleum and one for chrome ore :)

GhettoTrucker
07-20-2006, 11:08 PM
Oh ok... i see. I'm on it boss

GhettoTrucker
07-21-2006, 12:11 AM
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?


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
07-21-2006, 04:18 AM
-snip-

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

GhettoTrucker
07-21-2006, 04:34 AM
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.



-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
07-21-2006, 04:37 AM
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
07-21-2006, 03:15 PM
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.



-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
-If not in Hangks then try to adventure for it
-Then print "No ores were found in storage, but you're ready to mine."


Look good? its almost done! I think.


yep that's what i want.

GhettoTrucker
07-21-2006, 06:04 PM
One quick thing to check was that if there wasn't all of the mining gear found, then you need to adventure for it.


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.

arrggg
07-21-2006, 06:14 PM
Nope... if you don't have the gear, it's just like all the other places to adventure...

GhettoTrucker
07-21-2006, 07:27 PM
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.



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
{
<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!

arrggg
07-21-2006, 09:48 PM
I think your Greater-thens ">" should be Less-thens "<" and I think you are missing a ")" on line 3

Nightmist
07-22-2006, 01:30 AM
Nope... if you don't have the gear, it's just like all the other places to adventure...

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.)

GhettoTrucker
07-24-2006, 03:05 PM
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.)


So is this better?


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
{
<WHEN EVERYTHING =TRUE>
{
print("Ready!"); work?


EDIT:


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
07-25-2006, 05:25 AM
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()?


Example use of "{" and "}"

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.

GhettoTrucker
07-25-2006, 06:33 PM
Ok, now i see... I got a lot of cleaning up to do now....

macman104
07-26-2006, 05:36 AM
Ok, now i see... I got a lot of cleaning up to do now....
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
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.

GhettoTrucker
07-27-2006, 09:15 PM
so my mom took my laptop away so i won't be able to finish this for a while now...someone can go ahead and finish it if they would like...sorry