SRL Archive - SRL Archives

FindCoins


Bad Boy JH

2010-01-26 05:57:43

Whilst trying to figure out how to withdraw some coins i discovered that findcoins is broken….so I took some time…and I made a new one…using some functions…I wouldn't even have heard of yesterday…but it seems to do a good job… at this current stage it should work, and I do have a backup uptext check…but with some expert tweeking, that I am yet unable to do…it shouldn't need it…so without anymore rambling….

Function CoinFinder(var Tpoint:Tpoint):Boolean;
var
i:integer;
Tpnt:TPoint;
TPA:TPointArray;
ATPA:T2DPointArray;
begin
Result := False
Findcolorstolerance(TPA, 1540000, MBX1, MBY1, MBX2, MBY2, 10)
ATPA := TPAtoATPAEx(tpa, 20, 30)
for i:=0 to high(ATPA) do
if high(ATPA[i])>10 then
begin
TPnt := MiddleTPA(ATPA[i]);
MMouse(Tpnt.x, Tpnt.y, 5, 5)
If isuptext('oins') then
begin
result := true
TPoint:=TPnt
exit;
end;
end;
end;

Currently working for the bank only…but should be able to be modded for invo use also…but I am tired… so I am going to bed…school starts day after tomorrow…so if I don't make it work with it by this time tomorrow, don't expect me to do it…sorry…

RISK

2010-01-26 06:24:08

Simply make a DTM of the coins (avoiding the upper left hand corner) for it to check the inventory. The way this would work is..


program New;
{.include SRL/SRL.scar}

var X, Y: Integer;

procedure Example; //Our procedure to check inventory
begin
DTM HERE

if FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
//What to do if it finds the DTM.
end;

begin
end.

Isn't this what you're basically looking for?

weequ

2010-01-26 06:29:24

A single dtm wouldn't work if your making it able to find smaller amouths of coins too. Like 1 gp

Bad Boy JH

2010-01-26 19:19:59

yes, that was the main issue i was going for….i wanted it to be compatible for all the ammounts of coins…. 1-10 milllion and above…

Sex

2010-01-26 19:48:35

Then you would use colors.

Bad Boy JH

2010-01-26 19:56:39

Did you read my function, it uses colors…

Sex

2010-01-26 23:08:25

I was replying to anti miies/Risk.

Bad Boy JH

2010-01-27 01:55:50

ok then… I'll try to remember not everything is about me! :D

Bad Boy JH

2010-01-27 19:11:59

I figure a withdraw coins function would be useful as well, should that be made also, ie something like

withdrawcoins(amount:integer) and that will withdraw the amount of coins, just a few extra lines of simple code…