SRL Archive - OSR Help

Im in a conundrum ;s


Sin

2012-01-30 18:14:04

I have no clue if that's how you spell it but :p
Anyways, i'm making a Safe Cracker script.
I've gotten finding the safe down (via DTM's), now I only need to find out how to break the script from it's sleep once the safe has been cracked.
Any ideas?
I was thinking waiting for an xp rise but I have no clue how to do that… :ss

drawboy11

2012-01-30 18:18:52

Could you have it open the xp bar and have it check to see if the number at the top has changed? Like have it find the starting number Ex)+32 and when it changes then the script starts working on a safe again?

Nebula

2012-01-30 18:26:34

You could probably use WaitInvCount,

putonajonny

2012-01-30 18:29:39

I have no idea about safe cracking but if @Nebula's post is right then something like

Procedure WaitUntilDone;
Var
OldCount : Integer;
begin
OldCount := InvCount;
While(OldCount = InvCount) do
begin
Wait(200+Random(200));
AntiBan;
end;
Inc(SafesCracked);
end;

Nebula

2012-01-30 18:35:42

Sorry, that actually wouldn't work since safecracking also gives coins (stackables). So your best bet would be to learn how to incorporate the xp counter in your script.

Runaway

2012-01-30 18:49:39

From: Nebula
Sorry, that actually wouldn't work since safecracking also gives coins (stackables). So your best bet would be to learn how to incorporate the xp counter in your script.


You could wait for a change in coin amount OR a change in inv count. Should solve the problem.

Sin

2012-01-30 19:15:32

Sometimes NO coins are added :s
Otherwise i'd just add a FindBlackChatmessage :L

Brandon

2012-01-30 19:16:16

Do not use the XP counter alone.. some users will have "Lots!" in their XP bar and that will get you stuck in another conundrum or whatever you wanna call it.. Use that in combination with other things..

To Count stacked items for anyone who was wondering..

DTM := DTMFromString('mQwAAAHicY2ZgYMhlYmCoAuICIH4C5D8A4k9A3DJjJpBkgmIEYETCQAAAEhAF0w=='); //Just a random dtm..
writeln(ItemAmount('inv', 'dtm', DTM, [])); //Counts stacked Items.. Does not have to be a dtm..
FreeDTM(DTM);

CoinAmount('inv'); //<--- Returns the number of coins in the invent.
//Check out the Amount.Simba include.
So with that said.. just get a count of every item in the invent whether stacked or not.. it'll let your know successes vs fails.

Runaway

2012-01-30 19:19:58

From: S1N
Sometimes NO coins are added :s
Otherwise i'd just add a FindBlackChatmessage :L


Do you get an item and/or coins every time you crack the safe? Or can you crack it and have a chance of not getting anything?

Narcle

2012-01-30 19:21:20

Monitor the chat and use timers to break out if it takes to long.

E:
It tells you if you've failed and if successful plus what you got.

Sin

2012-01-30 19:24:31

From: Narcle
Monitor the chat and use timers to break out if it takes to long.

E:
It tells you if you've failed and if successful plus what you got.

It doesn't give an item always, + i'll have food in there

From: Runaway
Do you get an item and/or coins every time you crack the safe? Or can you crack it and have a chance of not getting anything?

Nope, you have a chance of not getting anything

From: ggzz
Do not use the XP counter alone.. some users will have "Lots!" in their XP bar and that will get you stuck in another conundrum or whatever you wanna call it.. Use that in combination with other things..

To Count stacked items for anyone who was wondering..

DTM := DTMFromString('mQwAAAHicY2ZgYMhlYmCoAuICIH4C5D8A4k9A3DJjJpBkgmIEYETCQAAAEhAF0w=='); //Just a random dtm..
writeln(ItemAmount('inv', 'dtm', DTM, [])); //Counts stacked Items.. Does not have to be a dtm..
FreeDTM(DTM);

CoinAmount('inv'); //<--- Returns the number of coins in the invent.
//Check out the Amount.Simba include.
So with that said.. just get a count of every item in the invent whether stacked or not.. it'll let your know successes vs fails.

No clue what to do o.O

Richard

2012-01-30 19:27:58

Am I right in saying that a recent update now causes a number which refers to your xp to appear above your character? You could do a colour check in the area around your character, count that the number of colours exceeds 10 or something, then exit the loop, and you've been successful.

Sin

2012-01-30 19:32:48

Hmm that should work, what method would I use? FindColor in a TBox?

Richard

2012-01-30 19:37:18

I'd recommend using a TPA method, do a FindColorsTolerance, then find the length of this TPA, ensure it is above a certain number. The problem with this is that you'd be essentially performing the same check over and over until it appeared.

Sin

2012-01-30 19:39:01

I found a different way.
I'm checking for the thieving Bitmap that occurs above the screen.
Should be easy that way, any way to get the coordinates on a smart window?

Nebula

2012-01-30 20:38:49

Drag the crosshairs

Slone

2012-01-30 20:47:36

Probably a silly suggestion as i cant really script but there would be no way that it could detect the safe door when its cracked it stays open for 2 or 3 seconds if i recall?

Narcle

2012-01-30 20:49:55

From: Slone
Probably a silly suggestion as i cant really script but there would be no way that it could detect the safe door when its cracked it stays open for 2 or 3 seconds if i recall?


This ^, I know it can be done. *cough*

PatDuffy

2012-01-30 20:54:01

From: Narcle
This ^, I know it can be done. *cough*


Hehe, that's a very good idea, look into that.