Lol. It kinda was... and I forgot to tell you not to double post for bumpage. Just link somebody to your post and ask them to help you, or wait till someone stumbles across your thread. Most questions get answered here by our kind forums users.
Ok, that helps a bunch, and sorry about double posting. For some reason, it goes back to the iron and withdraws 18 of it. Its finding the coal, because i wrote in:
And it doesn't say anything about coal not being found, and i tested it withe the game not up and it said "Coal not found"SCAR Code:if not FindDTM(Coal, x, y, 0, 0, 515, 334) then writeLn('Coal not found')
Is your coal DTM good? It could be thinking that it found the coal, but it's really iron. Your script would be working fine then, all except the coal DTM.
Temporarily inactive.
Hmmm, it could be just that. Does DTM just measure the points that I give it? If so then its probably doing just that, because the coal is more right than the iron, and it looks from top left to bottom right, correct?
FindDTM does, yes. I don't think there's a FindDTMSpiral, but if there was it would start from a different point. But that's not what you're trying to do.
From his tutorial located here. I would recommend checking this out if you're still having troubles with DTMs.Originally Posted by YoHoJo
Also to make sure your DTM is good, pick the DTM in the client then refresh the client. The colors should have all changed, so if your DTM is good you will still be able to find it and distinguish it from other objects of similar shapes (coal is similar to iron - this may be your problem).
Temporarily inactive.
Hmmm, ok, but couldn't I just use a bitmap, or is there a disadvantage to that?
Alright, but i tried it, and it still wont find the coal... so this is what I've got with the DTM:
SCAR Code:program Smelt;
{.include SRL/SRL.scar}
var
x, y: Integer;
a, b: Integer;
Iron: Integer;
Coal: Integer;
begin
SetupSRL;
Iron := DTMFromString('78DA631462606010604001EEDA8A609A1188F' +
'F0301A3349021CE800618914820AD00243809A8110512CC04D4B0' +
'13610E13901024A0861B484810A14686801A2122D4F012F61700E' +
'CAD05ED');
if FindDTM(Iron, a, b, 0, 0, 515, 334) then
begin
Mouse(a, b, 3, 3, False);
Wait(400+random(1000))
if not ChooseOption('draw X') then writeln('Withdraw X not found.');
Wait(500+Random(1000))
TypeSend('9');
end;
Coal := DTMFromString('78DA6314606060E0634001FA7AF2609A1188F' +
'F0301A32890C1C4800618914820CD43841A5620C141400DC80C5E' +
'22D4881350230824A408A89104126204D480828293801A1920C14' +
'A408D3490E027A0860B4848E3570300349E0606');
if not FindDTM(Coal, x, y, 0, 0, 515, 334) then writeLn('Coal not found')
begin
Mouse(x, y, 3, 3, False);
Wait(400+random(1000))
if not ChooseOption('draw X') then writeln('Withdraw X not found.');
Wait(500+random(1000))
Typesend('18');
end;
End.
However, its just not finding the coal.
Congratz on members Ducles![]()
I tested it, works fine for me
SCAR Code:program Smelt;
{.include SRL/SRL.scar}
var
x, y: Integer;
Iron, Timeout: Integer;
begin
SetupSRL;
wait(1000);
Iron := DTMFromString('78DA635CC9C8C0B09F010578EB2931C80169A' +
'00CC37F2060DC0E64ED6640038C4824905E0F649D20A066059075' +
'92809AB940D671026A6600590709A89945D8CD0096310EA5');
if FindDTM(Iron, x, y, 0, 0, 515, 334) then
begin
Mouse(x, y, 3, 3, False);
Wait(200+random(200))
if ChooseOption('draw X') then
while not GetColor(217, 400) = 0 do
begin
wait(100);
inc(Timeout);
if Timeout = 30 then Break;
end else writeln('not chooseopt draw X');
wait(750 + random(250));
TypeSend('10');
end;
end.
btw...about slow mouse speed, you can ste mouse speed like thisHigher = faster, lower = slowerSCAR Code:mousespeed:=25
[CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]
Hmmmmm, I don't know what I did, but I completely rewrote it, and made new DTMs and it works fine now. Weird,eh?
Negaal, I solved that problem long ago... its because I didn't setup SRL...
Arg... more problems. I tried putting in OpenBank in the beginning to open up the bank, but when I try to compile it, it tells me:
Here's where I put it:Failed when compiling
Line 10: [Error] (14691:9): Invalid number of parameters in script C:\Program Files\SCAR 3.13\Scripts\Smelting.scar
SCAR Code:program Smelt;
{.include SRL/SRL.scar}
var
x, y: Integer;
Iron: Integer;
Coal: Integer;
begin
SetupSRL;
OpenBank;
Iron := DTMFromString('78DA63F466646078C68002FC0C55C1342394C' +
'FE80764DD6440038CA86AC281ACBB04D44400598F08A80905B2DE' +
'1050E30564BD26A0C61DC8FA4C408D0311765903598F09A821267' +
'C5C80ACFBF8D50000F83A0DDA');
if not FindDTM(Iron, x, y, 0, 0, 515, 334) then WriteLn('Iron not found');
begin
//rest of script...
You usually need to put string of bank loc between the('')
function OpenBankQuiet(WhichBank: string): Boolean;
By: WT-Fakawi and modified by Ron
Description:
Opens any given bank in the free world using
FindDeformedBitmapToleranceIn. Avoids strange mouse movements. Will cause
significant lag (approx. 1 second), but finds the bank with one click.
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'eb' (Edgeville Bank)
'akb' (Al-Kharid Bank)
function FindBank(TheBank: String): Boolean;
By: WT-Fakawi and modified by Ron
Description:
Finds and opens any given bank in the free world. If symbolcolor
is in minimap it will walk to the bank and open it!
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
function OpenBankFast(Location: String): Boolean;
By: Wizzup? and Nielsie95
Description:
Opens the bank.
Valid arguments are:
'akb', 'al kharid', 'lb', 'lumbridge', 'veb', 'varrock east', 'vwb',
'varrock west', 'feb', 'falador east', 'fwb', 'falador west', 'db', 'draynor',
'eb', 'edgeville bank'
function OpenBank(WhichBank: String, ChangeCompass, ChangeAngle: Boolean): Boolean;
By: SRL Development Team
Description:
Opens the bank if possible.
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
'lb' (Lumbridge Bank)
EDIT: Sorry i didn't saw page 2...lol
Example:It clicks on bank on minimap and opens itSCAR Code:FindBank('fwb');![]()
[CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]
Ok, so I used OpenBankFast this time, and put in
and its telling meSCAR Code:OpenBankFast(feb);
Ok, so I got it to work with OpenBankQuiet, and it was giving me the above error because I didn't set it as a variable. But anyways, OpenBankQuiet causes too much of a lag, so I tried the others, with no luck. I set up the OpenBank with:Failed when compiling
Line 10: [Error] (14691:14): Unknown identifier 'feb' in script C:\Program Files\SCAR 3.13\Scripts\Smelting.scar
Then, it tells me that it is an unknown bank when I run it. Did I set it up wrong?SCAR Code:OpenBank(feb, false, false)
SCAR Code:function OpenBankFast(Location: String): Boolean;
Location is a string. Put 'feb' instead of just feb.
You're getting an error for the same reason with OpenBank.
Temporarily inactive.
Ok, that helps... but it yet again creates another problem. It now can't find the Iron or coal, and it was perfectly before... Heres what I've got:
SCAR Code:program Smelt;
{.include SRL/SRL.scar}
var
x, y: Integer;
Iron: Integer;
Coal: Integer;
feb: String;
begin
SetupSRL;
OpenBankFast('feb');
Iron := DTMFromString('78DA63F466646078C68002FC0C55C1342394C' +
'FE80764DD6440038CA86AC281ACBB04D44400598F08A80905B2DE' +
'1050E30564BD26A0C61DC8FA4C408D0311765903598F09A821267' +
'C5C80ACFBF8D50000F83A0DDA');
if not FindDTM(Iron, x, y, 0, 0, 515, 334) then WriteLn('Iron not found');
begin
Mouse(x, y, 3, 3, False);
Wait(400+random(1000))
if ChooseOption('draw X') then
begin
Wait(600 + Random(1000));
TypeSend('9');
end else WriteLn('Withdraw X not found');
end;
Coal := DTMFromString('78DA63AC64646078C28002CCCC54C1342394C' +
'F580B64DD6440038CA86A3281ACA704D4140259F709A86907B2EE' +
'1150D306643D26A0A619C87A45400DC8EFEF09A82922424D3990F' +
'59988F0794D404D0E90F500BF1A00C8581120');
if not FindDTM(Coal, x, y, 0, 0, 515, 334) then writeLn('Coal not found')
begin
Mouse(x, y, 3, 3, False);
Wait(400+random(1000))
if ChooseOption('draw X') then
begin
Wait(600 + Random(1000));
TypeSend('18');
end else WriteLn('Withdraw X not found');
end;
end.
Basically, it opens the bank, then all the failsafes go off, like it can't find anything.
Nvm.. the DTMs are bad again. Do they change every time you log in and out or something??
Any way that I can fix it?? Because i dont feel like making new DTMs every time I run it....
This could be because you have no waits after your OpenBankFast. I recommend a FFlag(0); and then small wait before checking, since the bank won't necessarily open instantly.
The DTMs don't change nor do the shapes of the items, but the colors do, which is one of the things a DTM is comprised of. You can fix it by adding tolerance (or more tolerance if you already have some) to your DTM. This is done in the DTM creation screen. Select the point and you can edit the tolerance of that point.
Temporarily inactive.
Arg... well whenever I raise the tolerance... it goes to the iron twice... maybe the two colors I picked are too alike? I tried to pick two totally different colors, I guess ill have to choose other ones, or is there another way to do this??
An "if IsUpText('ron') then" will stop you from withdrawing the incorrect item, but as to finding the right item after identifying the wrong would.. It'll be tough. Try using bitmaps instead of DTM's and do a low tolerance for the FindBitmapToleranceIn. Thats all I can think of right now.
I tried this:
Instead of using the Coal DTM and stuff, but it seems as though it doesn't, work... i stuck it in it's own script and it just goes below the bank, sits there, and stops.SCAR Code:begin
Wait(1000+random(1000))
Withdraw(5,8,18)
end;
I also tried your idea with the "if IsUpText('ron') then" however, I realized that the command "Mouse(x, y, 3, 3, False);" clicks as well, so i can't put it between putting the mouse at (x, y) and right clicking the coal, which takes away the text up top.
Are you saying you can't check the uptext because the mouse is clicking? If so, use a MMouse instead of Mouse. MMouse is the same as Mouse except it doesn't click. The parameters are also the same except for the end boolean on Mouse which tells you left or right click. You just drop that altogether.
SCAR Code:MMouse(x, y, rx, ry : Integer);
And I think my Coal DTM in my smelting script works... If you want you can use it. Just download the script, I made DTMs for a bunch of ores and bars (unnecessarily, but I didn't know it at the time :P).
Temporarily inactive.
Like that? Wow, your DTMs are pretty nice, they work fine with out the "if IsUpText('oal') then" but with it, it just says "Coal not found in bank".SCAR Code:Coal := DTMFromString('78DA632C67646078C48002E4E544187E0169A' +
'00CC37F20606C05B2EE30A00146241248D701593709A8C903B2EE' +
'13509305643D21A02613C87A45404D0E90F58E809A6220EB35116' +
'A3E1350534584394D40D65B026A5A80AC6704D4B403590FF0AB01' +
'003CDE173D');
if not FindDTM(Coal, x, y, 0, 0, 515, 334) then writeLn('Coal not found')
begin
MMouse(x, y, 3, 3);
Wait(400+random(300))
if IsUpText('oal') then
begin
Mouse(x,y, 3, 3, False);
end else WriteLn('Coal not found in bank');
if ChooseOption('draw X') then
begin
Wait(600 + Random(1000));
TypeSend('18');
end else WriteLn('Withdraw X not found');
end;
end.
There are currently 1 users browsing this thread. (0 members and 1 guests)