SRL Archive - General Botting Help

HELP, trying to make a automatic factory queue on a game called War Of Nations. DTM


Hackingmyself

2014-12-20 00:40:00

First of all I used Demise DTM Tutorial(Not allowed to post links) to learn how to make the DTM, But am getting compiling error: Error: Target cannot be assigned to at line 12
Compiling failed.

:fiery:


program Factoriesz;
{$i srl-6/srl.simba}
var
x, y: Integer;
begin
ClearDebug;
SetupSRL;
Factory := DTMFromString('mrAAAAHic42BgYJgKxI1AvAyIu4F4EhDPAeLZQKwMxNxAzAPEfEDMBsQCQCwIZYPEl578xuDg4MCw+ORXhlVnvoPZi05A2GpVBxgIAUYCGAYA6g0TgA==');

if FindDTM(Factory, x, y, 0, 0, 2000, 2000) then
begin
ClickMouse(x, y, 3, 3, Mouse_left);
end;
FreeDTM(Factory);
end.

Any Advice is extremely appreciated.

Hackingmyself

2014-12-20 01:01:17

UPdate: Sorry for wasting anyone's time, I will still be checking back on this if anyone has any more advice for a noob like me, I would love it but i got it compiling correctly now! :)

program Factoriesz;

{$i srl-6/srl.simba}

var
x, y: Integer;
Factory1: Integer;

begin
ClearDebug;
SetupSRL;
Factory1 := DTMFromString('mrAAAAHic42BgYJgKxI1AvAyIu4F4EhDPAeLZQKwMxNxAzAPEfEDMBsQCQCwIZYPEl578xuDg4MCw+ORXhlVnvoPZi05A2GpVBxgIAUYCGAYA6g0TgA==');

if FindDTM(Factory1, x, y, 0, 0, 2000, 2000) then
begin
ClickMouse(x, y, Mouse_right);
end;
FreeDTM(Factory1);
end.

cosmasjdz

2014-12-20 01:26:35

if FindDTM(Factory1, x, y, 0, 0, 2000, 2000) then


not sure if this but is your screen really 2000by 2000 pixels ?? Also do you drag the target to the window before running script?

Hackingmyself

2014-12-20 01:35:15

Yes about that, it was MIX1, MIY1, MIX2, MIY2 but that was causing errors, and this laptop is too slow to run the game, so until my processor for my desktop arrives that is just a placeholder.
While I was on my desktop I wrote something that clicked a factory opened it moved over to the right troops and set que.

program Factories;
{$Define Smart8}

Var
x, y:integer;

begin
MoveMouse(469, 434);
ClickMouse(470, 434, mouse_left);
Wait(900);
MoveMouse(251, 644);
ClickMouse(251, 644, mouse_left);
Wait(2500);
MoveMouse(900,344);
wait(600);
HoldMouse(900,344, mouse_left);
wait(600);
MoveMouse(251, 344);
wait(600);
ReleaseMouse(x, y, mouse_left);
wait(1500);
MoveMouse(900,344);
wait(600);
HoldMouse(900,344, mouse_left);
wait(600);
MoveMouse(251, 344);
wait(600);
ReleaseMouse(x, y, mouse_left);
wait(1000);
MoveMouse(586, 209);
ClickMouse(586, 209, mouse_left);
wait(500);
end

Can someone advise me, There will be up to 10 matching factories on the screen, I want to find the factory, then do similar to what I wrote (and tested working) above.
E:Yes I drag and target screen usually.

cosmasjdz

2014-12-20 04:43:33

From: Hackingmyself
Yes about that, it was MIX1, MIY1, MIX2, MIY2 but that was causing errors, and this laptop is too slow to run the game, so until my processor for my desktop arrives that is just a placeholder.
While I was on my desktop I wrote something that clicked a factory opened it moved over to the right troops and set que.

program Factories;
{$Define Smart8}

Var
x, y:integer;

begin
MoveMouse(469, 434);
ClickMouse(470, 434, mouse_left);
Wait(900);
MoveMouse(251, 644);
ClickMouse(251, 644, mouse_left);
Wait(2500);
MoveMouse(900,344);
wait(600);
HoldMouse(900,344, mouse_left);
wait(600);
MoveMouse(251, 344);
wait(600);
ReleaseMouse(x, y, mouse_left);
wait(1500);
MoveMouse(900,344);
wait(600);
HoldMouse(900,344, mouse_left);
wait(600);
MoveMouse(251, 344);
wait(600);
ReleaseMouse(x, y, mouse_left);
wait(1000);
MoveMouse(586, 209);
ClickMouse(586, 209, mouse_left);
wait(500);
end

Can someone advise me, There will be up to 10 matching factories on the screen, I want to find the factory, then do similar to what I wrote (and tested working) above.
E:Yes I drag and target screen usually.


I doubt your laptop had rezolution over 2000…. so for testing reduce it. dtms should work, about finding other 9 factories: make array of tpoints out of dtm mahes. but since if you have any tolerance and other often dtm finds like 4 very similar dots like 127,250 and 128,249 so you need to filter it out. Because for example find dtms() gives you array of t points:[(125,250),(127,248),(240,35),(239,34)] they give like in this example 4 points to 2 places. I use this routine to filter it out:

program blalblalbl;
{$Define Smart8}
var
i:integer;
FactoryArray:array [0..9] of tpoint;
box: tbox; // used to check if it is already in the box if no then its other factor than the first //one because like said before finddtms gives few posibilities in 10 factories it will give like 40 //points so need to filter it out.
procedure FindFactories();
var
i,z: integer;
p: tpointarray;
begin
if FindDtms(factoryDTM,p,inttobox(0,0,1250,650)) then
begin
for i:=0 to length(p)-1 do //-1 because arrays counts from 0 being first member
begin
box:=[p[i].x-50,p[i].y-50,p[i].x+50,p[i].y+50]; //this would make area for each //factory at 100 by 100 pixels.
for z:=0 to length(factryarray)-1 do
begin
if not pointinbox(p[i],factoryarray[z]) then // checks if point is already used as //factory point
begin// actually alittle flaw here, gona give you better code as i work on similar game too wtih dtms arrays when ill be back from work.
factoryarray[z]:=p[i];
break; // necessary to stop it writing the same coordinates to whole array.
end;
end;
end;
end;
end;
procedure mousemovements();//your mouse events
var
x,y: integer;
begin
MoveMouse(469, 434);
ClickMouse(470, 434, mouse_left);
Wait(900);
MoveMouse(251, 644);
ClickMouse(251, 644, mouse_left);
Wait(2500);
MoveMouse(900,344);
wait(600);
HoldMouse(900,344, mouse_left);
wait(600);
MoveMouse(251, 344);
wait(600);
ReleaseMouse(x, y, mouse_left);
wait(1500);
MoveMouse(900,344);
wait(600);
HoldMouse(900,344, mouse_left);
wait(600);
MoveMouse(251, 344);
wait(600);
ReleaseMouse(x, y, mouse_left);
wait(1000);
MoveMouse(586, 209);
ClickMouse(586, 209, mouse_left);
wait(500);
end;
for i:=0 to 9 do
begin
if not factoryarray.x=0 then mousemovements();
end;
end;

Hackingmyself

2014-12-20 19:45:24

Excellent info my man, Ill be working on this today and thanks for your help!

Hackingmyself

2014-12-21 20:12:21

Thank you for your help, monday(tomorrow) I will have my cpu and hopefully computer running, ill let you know if I have any troubles.
:stirthepot:
I am not yet allowed to send private messages.

Hackingmyself

2014-12-25 05:51:14

[ATTACH=CONFIG]24658[/ATTACH]
[ATTACH=CONFIG]24659[/ATTACH]
[ATTACH=CONFIG]24658[/ATTACH]
Happy holidays!
I had to delay the factory script because of the current event, but want to use your outline to identify and claim rewards, here are pictures I will be working on this and hope to finish late tomorrow, any more advice is great, THANK YOU!

cosmasjdz

2014-12-25 06:05:25

From: Hackingmyself
[ATTACH=CONFIG]24658[/ATTACH]
[ATTACH=CONFIG]24659[/ATTACH]
[ATTACH=CONFIG]24658[/ATTACH]
Happy holidays!
I had to delay the factory script because of the current event, but want to use your outline to identify and claim rewards, here are pictures I will be working on this and hope to finish late tomorrow, any more advice is great, THANK YOU!


uh um.. Dont get what particulary you need to do there. Thought u was searching for like 10 factories which look the same in the mainscreen…

My routine was from this script:

https://villavu.com/forum/showthread.php?t=111371

It looked and added to the memory every closed card position. After that i was selecting card 1 by 1 and it remembered each of the card position either closed one or opened and if 2 cards matched then showed the rest one which was closed.

Hackingmyself

2014-12-25 07:26:32

From: cosmasjdz
uh um.. Dont get what particulary you need to do there. Thought u was searching for like 10 factories which look the same in the mainscreen…

My routine was from this script:

https://villavu.com/forum/showthread.php?t=111371

It looked and added to the memory every closed card position. After that i was selecting card 1 by 1 and it remembered each of the card position either closed one or opened and if 2 cards matched then showed the rest one which was closed.


I had to delay that one because a different event started in the game, so this one just needs to click the claim reward when it shows up. After this event, (24hours) i can finish the original for factories.