SRL Archive - First Scripts

PieSheller


blother

2012-04-06 10:05:30

My first real attempt at a script and it works well enough for me to post it and get some feed back. There may be some issues with it, so please don't be upset :p

Some things i would like help with and/or advice:

-NPC banking (for GE)
-Making the code look neat
-Better failsafes
-Different ways to code it, so i can learn new methods
-Anything that doesn't work
-Proggy
-Any general advice

If you are giving any advice i would appreciate if you would not tell me exactly how to write it because i would like to give it a try first.

Setup:

-Be in varrock west bank, or change the the location
-Have pie dish in first slot and pastry dough in second slot, or visible on bank screen
-Make Withdraw X 14 if using DTM(would like to find a way to do this in script)

Change log:

-v1.1: Added logout failsafes through the script. Added withdraw function with DTM failsafe. Added multiple bank support (no GE or SW). Added attachment.

Striken

2012-04-06 23:46:11

Pretty good. Even though I hate DTM it's still good :p

elvenom

2012-04-07 03:35:31

Doesnt click pastry dough or pie dish

J J

2012-04-07 04:05:33

From: blother
CURRENTLY WILL NOT STOP BY ITSELF. I WILL BE TRYING TO FIGURE HOW TO DO IT, BUT IF YOU KNOW PLEASE TELL ME :P

This is probably the easiest way:
repeat {procedure}
until not(FindDTM(.......));
or
if not(FindDTM(......)) then
begin
Logout;
TerminateScript;
end else
begin
{procedure}
end;

Put the second one somewhere in your banking procedure, if it doesn't find the DTM for the ingredients it will log out and end the script.

blother

2012-04-07 10:27:37

From: J J
This is probably the easiest way:
repeat {procedure}
until not(FindDTM(.......));
or
if not(FindDTM(......)) then
begin
Logout;
TerminateScript;
end else
begin
{procedure}
end;

Put the second one somewhere in your banking procedure, if it doesn't find the DTM for the ingredients it will log out and end the script.


Oh i like that using the DTM. Makes sense because my script is DTM based :D Also, can you add multiple FindDTM… to the until() so i can account for both pastry dough and pie dishes?

Any time i want to end any script should i use TerminateScript, or are there any other ways to do it?

Doesnt click pastry dough or pie dish


I am sorry, but i can't stand this. This comment does not help me at all in making a change to the scipt. I added Writeln to help in finding where a particular part of the script might have messed up, so if you are not just trolling me then please tell me what message was written when it did not work.

Pretty good. Even though I hate DTM it's still good


Thanks i appreciate that :D If you know any other way to do it i would love to hear them. The main of this script for me is to learn different methods of scripting. If you different ways to go about the process i do want to try them so i can get more familiar with simba and writing.

Striken

2012-04-07 23:09:16

For withdrawing you can use this function

"Withdraw(0,0,AMOUNT)"

The first 0 is the Row, and the second 0 is the Column. 0,0 is the very first slot. You should know what "AMOUNT" is :)

blother

2012-04-07 23:43:20

From: Phyaskou
For withdrawing you can use this function

"Withdraw(0,0,AMOUNT)"

The first 0 is the Row, and the second 0 is the Column. 0,0 is the very first slot. You should know what "AMOUNT" is :)


Hmmm i think i might use that with an uptext check in case it cannot find the DTM. Although, then it should be able to make the shells unless as use inventory clicks there as well.

The reason i didn't use that at first was because i didn't want to force one slot to be used. When it is two items that are specific i don't see why a DTM would be a bad choice to a straight up withdraw.

Striken

2012-04-07 23:46:17

You may do the same for doing inventory slot.

blother

2012-04-10 13:33:01

From: Phyaskou
You may do the same for doing inventory slot.


The one thing i don't like about inventory slot is that it will not correctly if it doesn't withdraw 14 of each. This should only happen on the last load, but still would fudge it up a bit. I could use it with uptext check then DTM use like i did for banking, but the only purpose that would serve would be practice. Of course, i do need the practice :D

Striken

2012-04-10 18:53:18

You do need practice for inventory slots though. However the script should be babysat when it comes to something like this.

blother

2012-04-10 19:57:37

From: Phyaskou
You do need practice for inventory slots though. However the script should be babysat when it comes to something like this.


Probably true on the babysitting part, but i plan for it to not have to be. I think i'll go and add the inventory part and possibly a progress report. Might have a few other ideas to add as well.

Striken

2012-04-10 20:00:12

That's good. Learning is very good as it will come in handy some day.