ok so i changed the colours in the cache and now it looks like this:
![]()
ok so i changed the colours in the cache and now it looks like this:
![]()
what should be the code now i got this but to what i need to change it
Simba Code:program new;
{$i srl/srl.simba} //SRL INCLUDE
procedure AttackMonster;
var
x, y, attempts:integer; //Variable Declarations
begin
repeat //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
if findcolortolerance(x, y, 7430757, MSX1, MSY1, MSX2, MSY2, 10) then
begin
MMouse(x, y, 5, 5); //Moves mouse to color with 5 pixel's randomness
wait(randomrange(200, 500)); //Waits a random number between 200 and 500
end;
begin
writeln('We attempted more then 10 times to find the monster!');
Terminatescript; //then we stop the script.
end;
begin
SetupSRL;
AttackMonster;
end.
and i get this error
Code:[Error] C:\Program Files (x86)\Simba\Scripts\Mijn Script.simba(22:4): Identifier expected at line 21 Compiling failed.
Simba Code:program new;
{$i srl/srl.simba} //SRL INCLUDE
procedure AttackMonster;
var
x, y, attempts:integer; //Variable Declarations
begin
repeat //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
if findcolortolerance(x, y, 7430757, MSX1, MSY1, MSX2, MSY2, 10) then
begin
MMouse(x, y, 5, 5); //Moves mouse to color with 5 pixel's randomness
wait(randomrange(200, 500)); //Waits a random number between 200 and 500
//not clicking or something?
end else (* you have to add else to tell it to do otherwise *)
begin
writeln('We attempted more then 10 times to find the monster!');
Terminatescript; //then we stop the script.
end;
(*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
until False;
end; (*if you begin something, you should end it. this is not only the principle of life but of scripting as well ;) *)
begin
SetupSRL;
AttackMonster;
end.
ok so i changed the colours in the cache and now i have this:
and this is my code and how can i make it work now:
Simba Code:program new;
{$i srl/srl.simba} //SRL INCLUDE
procedure AttackMonster;
var
x, y, attempts:integer; //Variable Declarations
begin
repeat //Finds color with a bit of tolerance, it will mean if the color is a little bit off, it will still return true. Always use tolerance, colors in RS change frequently.
if findcolortolerance(x, y, 8021606, MSX1, MSY1, MSX2, MSY2, 10) then
begin
MMouse(x, y, 5, 5); //Moves mouse to color with 5 pixel's randomness
wait(randomrange(200, 500)); //Waits a random number between 200 and 500
end;
begin
writeln('We attempted more then 10 times to find the monster!');
Terminatescript; //then we stop the script.
end;
begin
SetupSRL;
AttackMonster;
end.
and i get this error when i run this script:
Code:[Error] C:\Program Files (x86)\Simba\Scripts\Mijn Script.simba(22:4): Identifier expected at line 21 Compiling failed.
You even commented it yourself '//Moves mouse to color with 5 pixel's randomness', so yeah its going to move there but if you don't tell it to click it wont click.
I've even added comment asking why aren't you clicking but i didn't add in in case you are just testing or something.
Add a ClickMouse2(mouse_Left) after MMouse, or use Mouse(x, y, 5, 5, mouse_Left), which is the combination of the 2.
Hi remember me,
Please check out this tutorial, and following that, this tutorial.
Regards,
~ Daniel.![]()
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
omg i am noob sorry that i dindn't saw that but i got only one problem you type
as commentbut how can i add that?Code:(*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
people said some things but i don't know where to add
thanks for the handy tutorials Daniel
omg i am noob sorry that i dindn't saw that but i got only one problem you typeOriginally Posted by riwu
You even commented it yourself '//Moves mouse to color with 5 pixel's randomness', so yeah its going to move there but if you don't tell it to click it wont click.
I've even added comment asking why aren't you clicking but i didn't add in in case you are just testing or something.
Add a ClickMouse2(mouse_Left) after MMouse, or use Mouse(x, y, 5, 5, mouse_Left), which is the combination of the 2.
as comment
but how can i add that?Code:(*possibly some procedure here to wait till it finish fighting so that it won't spam clicking?*)
people said some things but i don't know where to add
Last edited by Daniel; 10-19-2012 at 01:43 AM. Reason: Triple post.
i am now looking in the beginner's simba tutorial
but can i find there how i can make when it has killed the man or the monster
that it go search for another man or monster
Think about how you as a person would know that the npc is dead. I'm guessing it has something to do with the animation - and health bar (colors). Then try to apply that using the color finding functions
Red & Green Salamander Hunter // Construction // Gilded Altar // Major help w/ Kyles Runespan // VWB Smither // PhoenixFeathers // GemCutter // Bonfire // LRC Miner // Spell Tab Maker // ApeAtollAgility // IvyWC // RoguesCooker // Herblore // AshamanButterfly // AshamanPowerMiner // Fletcher // LividFarm
something like
that i click on that colour then if it can't find the colour green that the scripts knows
"ah, it's dead so i need to click another npc"
something like that?
Regardless of camera angle, the apperance of the health bar never changes, and some monsters that are powerful(have enough health) enough will still be fighting when the health bar appears to be fully depleted. You could take a DTM of the outline of the health bar, and check for that. Or, if its a weak monster, just look for green in the health bar.
Thx Euphemism and Vinyl for the awesome siggy and avatar!
what do you mean with dtm?
and how should the code looks like then
Watch Yohojo's DTM tutorial if the looking for green thing doesn't work.
Thx Euphemism and Vinyl for the awesome siggy and avatar!
gonna look it later gtds(got to do something)
i got now this code:
and i get this errorSimba Code:program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var HealthBar, X, Y: Integer;
begin
repeat
HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
Then Wait(300)
end else
begin
if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
until False;
end;
begin
end.
ok and i want to add that if he finds more then one it then waits and if he finds oneCode:[Error] C:\Program Files (x86)\Simba\Scripts\GhostKilling.simba(11:5): Identifier expected at line 10 Compiling failed.
he just click another monster because if you kill the monster then your bar stands there longer and i want that simba not wait for my bar to dissapear *sorry for my noobish english*
Last edited by remember me; 10-21-2012 at 07:02 PM.
Remove the 'end' beside the 'else', there is no begin (not needed since it's 1 command), hence there is no need for an 'end'.
ok i removed but when i use the code it just spam clicks and i get this error when i stop the
script:
and this is my simba code:Code:The following DTMs were not freed: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58]
Simba Code:program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var HealthBar, X, Y: Integer;
begin
repeat
HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
Then Wait(300)
else
begin
if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
until False;
end;
begin
setupsrl;
AttackMonster;
end.
For freeing the DTM you need to have:
Simba Code:FreeDTM(HealthBar);
now i got this code
and this error:Simba Code:program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var HealthBar, X, Y: Integer;
begin
repeat
HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
FreeDTM(HealthBar)
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
Then Wait(300)
else
begin
if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
until False;
end;
begin
setupsrl;
AttackMonster;
end.
how to fix this?Code:[Hint] C:\Program Files (x86)\Simba\Includes\SRL/SRL/core/globals.simba(55:3): Variable 'WORLDSWITCHERENABLED' never used at line 54 Compiled successfully in 624 ms. SRL Compiled in 15 msec Error: Exception: The given DTM Index[2] doesn't exist at line 9 The following DTMs were not freed: [SRL - Lamp bitmap, 1] The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]
The
has to be in the procedure, but after you're done using it.Simba Code:FreeDTM(HealthBar)
Like this:
Simba Code:program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var HealthBar, X, Y: Integer;
begin
repeat
HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt');
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2)
Then Wait(300)
else
begin
if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
until False;
FreeDTM(HealthBar)// Here
end;
begin
setupsrl;
AttackMonster;
end.
Last edited by Ian; 10-22-2012 at 11:04 PM.
Try this- note there were variouus issues with the code
Simba Code:program GhostKilling;
{$i srl/srl.simba}
Procedure AttackMonster;
Var
HealthBar, X, Y: Integer;
Begin
HealthBar := DTMFromString('mwQAAAHic42RgYJBhgABzKBuEGaHYDIqZkTAIsCHRcPYEBgYhISG8mBjASASGAwCmnANt'); //Dont constantly declare the dtm in the loop
Repeat
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
Wait(300);
End
Else
Begin
//Why did you free the DTM before using it?
If findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
Begin
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
End;
End;
Until False;
FreeDTM(HealthBar); //Free it after the function
End;
begin
setupsrl;
AttackMonster;
end.
E: @BMXi there are also other issues i.e. this
This basicly tells the mouse to wait and click regardless of whether colour was found or notSimba Code:begin
if findcolortolerance(x, y, 10786969, MSX1, MSY1, MSX2, MSY2, 10) then
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
corrections in my code above
Last edited by Enslaved; 10-22-2012 at 11:16 PM.
Guides:Lape Basics ---Multi-Dimensional Arrays --- Dung Guide , Scripts:Cooking guilder --- Enslaved Fletcher --- EnslavedHumidity
ok now i got this code
Simba Code:program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var
HealthBar, X, Y: Integer;
begin
HealthBar := DTMFromString('mrAAAAHic42BABaZQLAPFZkDMDMRsSGrYkPhguQkMDEJCQjjxfwb8gJEAhgEAlDEEEA==');
repeat
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
Wait(300)
end
Else
begin
if findcolortolerance(x, y, 11119020, MSX1, MSY1, MSX2, MSY2, 10) then
Begin
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
End;
until False;
FreeDTM(HealthBar);
end;
begin
setupsrl;
AttackMonster;
end.
but now i want that it not just keeps clicking i want that it click one time like that this lines:
just click once because if it clicks on an monster it keeps clicking and clicking and thanSimba Code:MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
it clicks on other monsters and then my man is gonna walk away and... that takes houres
Can you help me?
Last edited by remember me; 10-25-2012 at 05:51 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)