SRL Archive - OSR Help

Problem for ChooseOption and WaitOption


CephaXz

2012-04-25 19:46:12


Procedure WithdrawEss;
begin
//Withdraw Essence
if BankScreen then
begin
MouseBankSlot(1, mouse_move);
writeln('Withdrawing Pure Essence');
ClickMouse2(mouse_Right);
WaitOption('All', 300);
end;
end;

So I finally finish my cosmic runecrafter. But there's a problem on withdrawing items from bank. It sometimes just right click the essence but did not choose the withdraw all option. I've tried repeat this procedure until InvFull, but it will always withdraw 2 times, refill pouches, withdraw 2 times, refill again, and withdraw 2 times again, which is very bot-like. What can I do so that it withdraws the essence every single time?

John

2012-04-25 20:17:15

Are you sure it's All not all or ALL?

Total

2012-04-25 20:19:06

Try something like

WaitOptionMulti(['Withdraw-All', 'w-A', 'll'], 1000);

CephaXz

2012-04-25 20:25:12

From: Evlin
Are you sure it's All not all or ALL?


Yes, it's All.

From: TotalKillz
Try something like

WaitOptionMulti(['Withdraw-All', 'w-A', 'll'], 1000);


Thanks, I'll try that. Maybe I should just post the whole script here so that someone can tell me where I did wrong, what can be improved and such? Whenever I stop the script, there's always DTMs not freed, maybe I don't know how to free it correctly.

Total

2012-04-25 20:40:16

I wouldn't post it if you don't want people using it, but if you are not freeing DTMs you could try just loading all the DTMs in the beginning instead of putting them in procedures. So just make a procedure called GetDTMs or something then load your DTMs, and use GetDTMs before your loop of the main script.

CephaXz

2012-04-25 20:50:02

I hope people won't find scripts at help section? lol
If I load them at the beginning, don't I need to free them after I've used them? Like for example, I went to bank to refill pouches, I load pouches DTMs and refill them, then free pouches DTMs, and repeat after every banking process.
Sorry, still a newb. I don't even have a single function in my script because I still don't know how to use it and the difference of it from procedure.

Oh by the way, the waitoptionmulti works better now. I thought waitoption will search for the option after the time given, making the banking process slower.

Total

2012-04-25 20:57:10

Well this is what I do.


procedure GetDTMs;
begin
BankBoothDTM := DTMFromString('mbQAAAHicY2VgYNBiZGBQAGJtINYAYgMgngcUnwPEU4F4KRAvBOL85FCGI3v2MLSUpTGkx/gzeNgaMPADxdExIxYMBgDBAgrH');
BankDTM := DTMFromString('mlwAAAHicY2dgYAhhYmDwBOJkIHYF4gogdgfiLCCuBsrXAHEOEOcD8QwgTgDiWhB7cjdDQ00JQ2S8NENanCZDW/dkhllTexmy0uIZ+IHyuDAjHgwFAKpTD7A=');
RingDTM := DTMFromString('mggAAAHicY2NgYNjLxMCwEYj3AfFWJgh/GxBXMDIw1ANxCxC3AXEtEFcDsfgcKYZzm+QYGvOFGa5sl2e4sVuBob9GlIEfaBY2zIgDQwAAM04PsQ==');
GraahkDTM := DTMFromString('mggAAAHicY2NgYHgBxM+A+A0QfwTiu0D8BIjzgTgTiguBOBdKH8q3ZqjOCALjTWtnMbQ2FoPF+IFy2DAjDgwBALoXERc=');
NatsDTM := DTMFromString('mlwAAAHicY2dgYHgExM+B+C4QPwXi10D8HiqWB8T5QFwExCVAXAzEuUCcBcSCtSJgHOTvzxAfHc1QlJvLMLW/DyzGBZTHhRnxYCgAALzIEJc=');
EnergyPotDTM := DTMFromString('mggAAAHicY2NgYMhiZGDIBOI0IM4B4hQgzgXiQqBcFRCXQXE+EBcBcbmTF5BkYujwCWUocfBg6PINY0gwtWHgB4piw4w4MAQAAIPHCsM=');
AltarDTM := DTMFromString('mwQAAAHic42RgYGBiZGBgBOKvQDYfkGYGYhYg/gTkizFCcDSQHcgAoWOAOBmIC4HYB4h9gTgXiHNy0hniouNRcFZWKlg8OjqcIT4+moEfqI4QZiQCwwEAYO4QRg==');
RuinsDTM := DTMFromString('mWAAAAHicY2FgYGBnZGB4DaTFgDQfEIcB2QlA7A/ElUC8/K8fQ3p6EkNUVBhDcnIcAz9QDBkzomEQAACwiwgs');
SpellDTM := DTMFromString('mggAAAHicY2NgYNjOxMCwHoi3AfE+IN4LxOuA+ClQ7iEQ34PSz4H4CRC/fv2Kof7QJwyMCzDiwBAAAH3uF20=');
DarkMageDTM := DTMFromString('mlwAAAHicY2dgYNjEyMCwiBFCHwHi00B8CojnAXE/UL4ViHOBuBiIpwJxBxBPB+JDcxsZji5oZji+sIVhamUSQ3qSP0NmSgDDjJpUBn6gPC7MiAdDAQChAxP2');
ContinueDTM := DTMFromString('mggAAAHicY2NgYPgOxCKMDAwvgDQPkFYEYkkgvgzEV4D4KhCfh/JBtEmUIINOMB+DegAvQ1KHNZif0GbJwA/Ujw0z4sAQAAAVgwwq');
VialDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIAeJiJgg7DYiLgDgHiHkZGRh4oFgUiIWAWBCI2YE4NDQSqJsJjCMjYxkSElMZ7B2cGKKi4xj4gaK4MCMeDAUAXQII9g==');
PathToAltarDTMs[0] := DTMFromString('mbQAAAHicY2VgYJjNxMCwGIjnAPEEIG4EYk+guA0QB0FxIBB3lWkztHfPYsi2FQBjkzgxBn6gODpmxILBAAC8KQm0');
PathToAltarDTMs[1] := DTMFromString('mbQAAAHicY2VgYFjOxMCwAIgXAvFsIN4IxBFA8SIgLgfiXCC2A+LaNl0GxUhRhlBneYbyXC0wmx8ojo4ZsWAwAADFDwmT');
PathToAltarDTMs[2] := DTMFromString('mbQAAAHicY2VgYFjGxMCwFojLgbgOin2A4okMENoKiB2AuKTVjmHhwvkM8lGiDJLOQgzBLvIM/EBxdMyIBYMBAKeuCWM=');
PathToAltarDTMs[3] := DTMFromString('mggAAAHicY2NgYFjKxMBQDsSVQFwMxI1QbAKUUwFiTSCWAGIbIHYE4oYOLQbVYH6GSFtJMA1j8wPlsGFGHBgCAPntCLg=');
PathToAltarDTMs[4] := DTMFromString('mlwAAAHicY2dgYFjAxMDQC8T9QLwCiucAcR8QWwPl3YHYF4idgdgTiN2A2ByIVYMFwTjSVhpOR2YpMUzu0WXgB8rjwox4MBQAAKkvC8I=');
PathToAltarDTMs[5] := DTMFromString('mwQAAAHic42RgYJjMxMAwAYgnAnELEp4DxHOBuAaIi4HqMoE4D4jzgbgSiEuhuAqI24DYM12FQT5EhCHYTg5Mg7CaBC9cDIT5geoIYUYiMBwAANXdDwU=');
PathToAltarDTMs[6] := DTMFromString('mggAAAHicY2NgYFjDxMAwC4qnAPFUIF4IxGlAuXQgzgHiYCCOAOJ8IK6u12BQDBZkCLWVRqH5gXLYMCMODAEArg8Kew==');
PathToAltarDTMs[7] := DTMFromString('mggAAAHicY2NgYEhjYmDIBeJoII4D4nAgjgLiFKBcOhAXAnEJA4SfAcRhztIMSpGCYAxjg2h+oBw2zIgDQwAA/eII7A==');
end;

procedure Free;
begin
FreeDTM(BankBoothDTM);
FreeDTM(RingDTM);
FreeDTM(BankDTM);
FreeDTM(GraahkDTM);
FreeDTM(NatsDTM);
FreeDTM(EnergyPotDTM);
FreeDTM(AltarDTM);
FreeDTM(RuinsDTM);
FreeDTM(SpellDTM);
FreeDTM(DarkMageDTM);
FreeDTM(ContinueDTM);
FreeDTM(VialDTM);
FreeDTMs(PathToAltarDTMs);
end;

And then in my main loop I have

procedure MainLoop;
begin
AddOnTerminate('Free');
GetDTMs;
//rest of my main loop after
end;

CephaXz

2012-04-25 21:05:45

Mind explaining what AddOnTerminate do?

EDIT: Wow! You used DTMs for your path to altar:eek:

Total

2012-04-25 21:07:12

When you stop the script/the script ends it will run the procedure that you have in it. So when I stop the script it will run Free which will release all of my DTMs.

CephaXz

2012-04-25 21:41:05

Thanks! Script is getting better now.
I have questions again. For depositing or withdrawing from bank, the text color of the item is orange. Can WaitUptext or IsUptext detect the colored text? I can't make it work somehow.

Total

2012-04-25 21:52:06

I've found orange text to be the most troublesome for me. In multiple scripts if I check for uptext/options that are orange they work sometimes, but not always. I used to have a failsafe to log out when out of essence by checking the uptext for Pure or whatever but I took it out because it kept logging out when I still had essence.

CephaXz

2012-04-25 22:03:08

That is my purpose of having check uptext when withdrawing essence, I took it out too because the uptext checking never work for me. Thanks for letting me know.

NKN

2012-04-25 22:09:16

Orange works for me on Uptext.

Just saying.

Google

2012-04-25 22:32:46

From: CephaXz

Procedure WithdrawEss;
begin
//Withdraw Essence
if BankScreen then
begin
MouseBankSlot(1, mouse_move);
writeln('Withdrawing Pure Essence');
ClickMouse2(mouse_Right);
WaitOption('All', 300);
end;
end;

So I finally finish my cosmic runecrafter. But there's a problem on withdrawing items from bank. It sometimes just right click the essence but did not choose the withdraw all option. I've tried repeat this procedure until InvFull, but it will always withdraw 2 times, refill pouches, withdraw 2 times, refill again, and withdraw 2 times again, which is very bot-like. What can I do so that it withdraws the essence every single time?



Your asking it to go to the essence right click it then wait for option "all" the code should look like this


Procedure WithdrawEss;
Begin
If BankScreen Then
Begin
MouseBankSlot(1, mouse_move);
Wait(200 + Random(200));
WriteLn('Withdrawing Pure Essence');
ClickMouse2(mouse_Right);
Wait(200 + Random(200)); // have for lag or just till it recognizes the uptext
ChooseOption('Withdraw-All');
end;
end;

There you go that should be good to go^

- GOOGLE

CephaXz

2012-04-26 01:18:53

From: NKN
Orange works for me on Uptext.

Just saying.


Which function you're using to make uptext work on orange? WaitUptext?

From: GOOGLE
Your asking it to go to the essence right click it then wait for option "all" the code should look like this


Procedure WithdrawEss;
Begin
If BankScreen Then
Begin
MouseBankSlot(1, mouse_move);
Wait(200 + Random(200));
WriteLn('Withdrawing Pure Essence');
ClickMouse2(mouse_Right);
Wait(200 + Random(200)); // have for lag or just till it recognizes the uptext
ChooseOption('Withdraw-All');
end;
end;

There you go that should be good to go^

- GOOGLE


Thanks, I solved that :)

NKN

2012-04-26 07:06:21

I use WaitUpText, yeah. It works better for me, set the time in WaitUpText to like, three seconds so it has time to look. It usually works in half a second or so.

Joe

2012-04-26 07:53:15

From: TotalKillz
Well this is what I do.


procedure GetDTMs;
begin
BankBoothDTM := DTMFromString('mbQAAAHicY2VgYNBiZGBQAGJtINYAYgMgngcUnwPEU4F4KRAvBOL85FCGI3v2MLSUpTGkx/gzeNgaMPADxdExIxYMBgDBAgrH');
BankDTM := DTMFromString('mlwAAAHicY2dgYAhhYmDwBOJkIHYF4gogdgfiLCCuBsrXAHEOEOcD8QwgTgDiWhB7cjdDQ00JQ2S8NENanCZDW/dkhllTexmy0uIZ+IHyuDAjHgwFAKpTD7A=');
RingDTM := DTMFromString('mggAAAHicY2NgYNjLxMCwEYj3AfFWJgh/GxBXMDIw1ANxCxC3AXEtEFcDsfgcKYZzm+QYGvOFGa5sl2e4sVuBob9GlIEfaBY2zIgDQwAAM04PsQ==');
GraahkDTM := DTMFromString('mggAAAHicY2NgYHgBxM+A+A0QfwTiu0D8BIjzgTgTiguBOBdKH8q3ZqjOCALjTWtnMbQ2FoPF+IFy2DAjDgwBALoXERc=');
NatsDTM := DTMFromString('mlwAAAHicY2dgYHgExM+B+C4QPwXi10D8HiqWB8T5QFwExCVAXAzEuUCcBcSCtSJgHOTvzxAfHc1QlJvLMLW/DyzGBZTHhRnxYCgAALzIEJc=');
EnergyPotDTM := DTMFromString('mggAAAHicY2NgYMhiZGDIBOI0IM4B4hQgzgXiQqBcFRCXQXE+EBcBcbmTF5BkYujwCWUocfBg6PINY0gwtWHgB4piw4w4MAQAAIPHCsM=');
AltarDTM := DTMFromString('mwQAAAHic42RgYGBiZGBgBOKvQDYfkGYGYhYg/gTkizFCcDSQHcgAoWOAOBmIC4HYB4h9gTgXiHNy0hniouNRcFZWKlg8OjqcIT4+moEfqI4QZiQCwwEAYO4QRg==');
RuinsDTM := DTMFromString('mWAAAAHicY2FgYGBnZGB4DaTFgDQfEIcB2QlA7A/ElUC8/K8fQ3p6EkNUVBhDcnIcAz9QDBkzomEQAACwiwgs');
SpellDTM := DTMFromString('mggAAAHicY2NgYNjOxMCwHoi3AfE+IN4LxOuA+ClQ7iEQ34PSz4H4CRC/fv2Kof7QJwyMCzDiwBAAAH3uF20=');
DarkMageDTM := DTMFromString('mlwAAAHicY2dgYNjEyMCwiBFCHwHi00B8CojnAXE/UL4ViHOBuBiIpwJxBxBPB+JDcxsZji5oZji+sIVhamUSQ3qSP0NmSgDDjJpUBn6gPC7MiAdDAQChAxP2');
ContinueDTM := DTMFromString('mggAAAHicY2NgYPgOxCKMDAwvgDQPkFYEYkkgvgzEV4D4KhCfh/JBtEmUIINOMB+DegAvQ1KHNZif0GbJwA/Ujw0z4sAQAAAVgwwq');
VialDTM := DTMFromString('mlwAAAHicY2dgYMhlYmBIAeJiJgg7DYiLgDgHiHkZGRh4oFgUiIWAWBCI2YE4NDQSqJsJjCMjYxkSElMZ7B2cGKKi4xj4gaK4MCMeDAUAXQII9g==');
PathToAltarDTMs[0] := DTMFromString('mbQAAAHicY2VgYJjNxMCwGIjnAPEEIG4EYk+guA0QB0FxIBB3lWkztHfPYsi2FQBjkzgxBn6gODpmxILBAAC8KQm0');
PathToAltarDTMs[1] := DTMFromString('mbQAAAHicY2VgYFjOxMCwAIgXAvFsIN4IxBFA8SIgLgfiXCC2A+LaNl0GxUhRhlBneYbyXC0wmx8ojo4ZsWAwAADFDwmT');
PathToAltarDTMs[2] := DTMFromString('mbQAAAHicY2VgYFjGxMCwFojLgbgOin2A4okMENoKiB2AuKTVjmHhwvkM8lGiDJLOQgzBLvIM/EBxdMyIBYMBAKeuCWM=');
PathToAltarDTMs[3] := DTMFromString('mggAAAHicY2NgYFjKxMBQDsSVQFwMxI1QbAKUUwFiTSCWAGIbIHYE4oYOLQbVYH6GSFtJMA1j8wPlsGFGHBgCAPntCLg=');
PathToAltarDTMs[4] := DTMFromString('mlwAAAHicY2dgYFjAxMDQC8T9QLwCiucAcR8QWwPl3YHYF4idgdgTiN2A2ByIVYMFwTjSVhpOR2YpMUzu0WXgB8rjwox4MBQAAKkvC8I=');
PathToAltarDTMs[5] := DTMFromString('mwQAAAHic42RgYJjMxMAwAYgnAnELEp4DxHOBuAaIi4HqMoE4D4jzgbgSiEuhuAqI24DYM12FQT5EhCHYTg5Mg7CaBC9cDIT5geoIYUYiMBwAANXdDwU=');
PathToAltarDTMs[6] := DTMFromString('mggAAAHicY2NgYFjDxMAwC4qnAPFUIF4IxGlAuXQgzgHiYCCOAOJ8IK6u12BQDBZkCLWVRqH5gXLYMCMODAEArg8Kew==');
PathToAltarDTMs[7] := DTMFromString('mggAAAHicY2NgYEhjYmDIBeJoII4D4nAgjgLiFKBcOhAXAnEJA4SfAcRhztIMSpGCYAxjg2h+oBw2zIgDQwAA/eII7A==');
end;

procedure Free;
begin
FreeDTM(BankBoothDTM);
FreeDTM(RingDTM);
FreeDTM(BankDTM);
FreeDTM(GraahkDTM);
FreeDTM(NatsDTM);
FreeDTM(EnergyPotDTM);
FreeDTM(AltarDTM);
FreeDTM(RuinsDTM);
FreeDTM(SpellDTM);
FreeDTM(DarkMageDTM);
FreeDTM(ContinueDTM);
FreeDTM(VialDTM);
FreeDTMs(PathToAltarDTMs);
end;

And then in my main loop I have

procedure MainLoop;
begin
AddOnTerminate('Free');
GetDTMs;
//rest of my main loop after
end;


Oh, I didn't know we lived in the Matrix!

OT: instead of waituptext, use waitUpTextMultiCustom('Poops', 'Toilet', 'Flush');
you can use more words and the more words you use the better the detection