In my script in the main loop function i declare the "t" varible is equel to:
t := GetTimeRunning div 1000+1;
and each of my procedures displays:
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
But it only goes to 1 even if its been running more then 1 seconds..
Wardancer
12-11-2012, 09:39 PM
Doesn't matter if it's for rs or not. It returns the time since the script was started.
EDIT: I strongly suggest you to read the includes and try to understand them before posting. You'll learn a lot more this way. There usually is a description of what the procedure or function does.
Doesn't matter if it's for rs or not. It returns the time since the script was started.
so how would i include that?
If it requires any addional downloads I would rather do it a different way so other people can use the script
Wardancer
12-11-2012, 09:43 PM
so how would i include that?
If it requires any addional downloads I would rather do it a different way so other people can use the script
Please read the edit of my previous post. I believe you have all the necessary information to solve your problem.
Wardancer
12-11-2012, 09:45 PM
GetTimeRunning automatically puts it into Hours Minutes Seconds i thought
I doubt it as TimeRunning uses GetTimeRunning as its ms variable.
EDIT:
I see "thetime" and "timerunning" in the includes.And it appears that I am currently using "timerunning" and it's not working.. so..
Read the actual function and its description. Also read the functions that are called by it. Try to understand what you're working with. You won't learn much otherwise.
I doubt it as TimeRunning uses GetTimeRunning as its ms variable.
EDIT:
Read the actual function and its description. Also read the functions that are called by it. Try to understand what you're working with. You won't learn much otherwise.
Get an error when i include it...
{$i timing/timing.simba}
Wardancer
12-11-2012, 10:09 PM
Get an error when i include it...
{$i timing/timing.simba}
It is already included by {$i srl/srl.simba}. You only have to add an extra line for the includes that aren't in the core folder of srl. An easy way to know if you have access to a function in an include is to search it from your script. If you can find it, there is no need to add any line.
Wardancer
12-11-2012, 10:16 PM
Your t will only equal GetTimeRunning div 1000+1 when you call it. It won't, by itself, adjusts over the course of time. I don't see your full script, but I assume that's the issue.
Heres my script:
{
-------------------------------VALID MONSTERS---------------------------------
-skeleton,ghost,warewolf,dwarf,bat,druid
If you want more added ask me on thread. some are not reliable such as guards.
DO NOT WEAR A FIGHTER TORSO IF YOU ARE FIGHTING SKELETONS
}
Program autofight;
{$i srl/srl.simba}
const
time = 2; // in seconds
monsterkill = ('ghost');
breaking = ('Yes');
minbreaktime = 4;
maxbreaktime = 9;
breakrate = 200;
hpbarx = 213;
hpbary = 90;
hpbarx2 = 335;
hpbary2 = 201;
//status1 = ('waiting to get out of combat')
//status2 = ('Attacking ')
var
hpbar,skelet,ghost,dwarf,druid,bat,warewolf,kills, t,outcome,bitch: Integer;
resulte,qtab,invtab:Integer;
status:string;
procedure breakin;
var
X, Y: Integer;
begin
outcome := Random(breakrate);
bitch := (maxbreaktime*60000)-(minbreaktime*60000);
resulte := Random(bitch)
if outcome = 1 then
begin
TypeSend('brb afk');
Wait(1100 + Random(500));
if FindDTM(qtab, x, y, 536, 194, 755, 225) then
begin
mmouse(x, y,1,1);
Wait(1450 + Random(50));
ClickMouse(x, y, mouse_Left);
if FindColorTolerance(X,Y,3424328,563,247,639,257,15) then
begin
mmouse(x, y,1,1);
Wait(350 + Random(50));
ClickMouse(x, y, mouse_Left);
if FindDTM(qtab, x, y, 536, 194, 755, 225) then
begin
mmouse(x, y,1,1);
Wait(350 + Random(50));
ClickMouse(x, y, mouse_Left);
begin
wait(minbreaktime+resulte)
end;
end;
end;
end;
end;
end;
procedure CheckCombat;
var
X, Y: Integer;
begin
ClearDebug;
status := ('Waiting to get out of combat.');
writeln('Status:' + status + monsterkill + '.');
Writeln('Kills:' + Tostr(kills));
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
Wait((time * 500) + Random(1000));
begin
repeat
until (FindDTM(hpbar, x, y, hpbarx, hpbary, hpbarx2, hpbary2)=false);
end;
IncEx(kills, 1);
breakin;
end;
procedure ClickWarewolf;
var
X, Y: Integer;
begin
if FindDTM(warewolf, x, y, 4, 6, 512, 333) then
begin
ClearDebug;
status := ('Attacking ');
writeln('Status:' + status + monsterkill + '.');
Writeln('Kills:' + Tostr(kills));
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
MouseSpeed:=45;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
Wait(1800 + Random(500));
CheckCombat;
end;
end;
procedure ClickBat;
var
X, Y: Integer;
begin
if FindDTM(bat, x, y, 4, 6, 512, 333) then
begin
ClearDebug;
status := ('Attacking ');
writeln('Status:' + status + monsterkill + '.');
Writeln('Kills:' + Tostr(kills));
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
MouseSpeed:=45;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
Wait(1800 + Random(500));
CheckCombat;
end;
end;
procedure ClickDruid;
var
X, Y: Integer;
begin
if FindDTM(druid, x, y, 4, 6, 512, 333) then
begin
ClearDebug;
status := ('Attacking ');
writeln('Status:' + status + monsterkill + '.');
Writeln('Kills:' + Tostr(kills));
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
MouseSpeed:=45;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
Wait(1800 + Random(500));
CheckCombat;
end;
end;
procedure ClickDwarf;
var
X, Y: Integer;
begin
if FindDTM(dwarf, x, y, 4, 6, 512, 333) then
begin
ClearDebug;
status := ('Attacking ');
writeln('Status:' + status + monsterkill + '.');
Writeln('Kills:' + Tostr(kills));
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
MouseSpeed:=45;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
Wait(1800 + Random(500));
CheckCombat;
end;
end;
procedure ClickGhost;
var
X, Y: Integer;
begin
if FindDTM(ghost, x, y, 4, 6, 512, 333) then
begin
ClearDebug;
status := ('Attacking ');
writeln('Status:' + status + monsterkill + '.');
Writeln('Kills:' + Tostr(kills));
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
MouseSpeed:=45;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
Wait(1800 + Random(500));
CheckCombat;
end;
end;
procedure ClickSkeleton;
var
X, Y: Integer;
begin
if FindDTM(skelet, x, y, 4, 6, 512, 333) then
begin
ClearDebug;
status := ('Attacking ');
writeln('Status:' + status + monsterkill + '.');
MouseSpeed:=25;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
Wait(1800 + Random(500));
CheckCombat;
end;
end;
procedure Chooseproc;
begin
if monsterkill = ('ghost') then
begin
ClickGhost;
end;
if monsterkill = ('skeleton') then
begin
Clickskeleton;
end;
if monsterkill = ('bat') then
begin
ClickBat;
end;
if monsterkill = ('druid') then
begin
ClickDruid;
end;
if monsterkill = ('warewolf') then
begin
Clickwarewolf;
end;
if monsterkill = ('dwarf') then
begin
Clickskeleton;
end;
end;
var
X,Y,s: Integer;
begin
t := GetTimeRunning div 1000+1;
skelet := DTMFromString('mLgAAAHicY2JgYIhjZGCIBuK9QPZJIO7paW Joaqpk4ASyQZgRihkYAJb8BW8=');
ghost := DTMFromString('mLgAAAHicY2JgYLgKxDeAuB6Im4F43twlDD NnLmFgAbJBmBGKGRgAuZgGcQ==');
druid := DTMFromString('mLgAAAHicY2JgYChiZGAoAOIdQPZWIJ6R5s 6wd/MMBhYgG4QZoZiBAQCdPQWr');
bat := DTMFromString('mLgAAAHicY2JgYEhhZGDIAOJlQPZSIC7ITG cozc1hYAGyQZgRihkYAIVaBLQ=');
dwarf := DTMFromString('mLgAAAHicY2JgYIhihOBgEBuIm6uqGFq0FB lYgWwQZoRiBgYAaUADuA==');
warewolf := DTMFromString('mLgAAAHicY2JgYFjEyMCwDIhNgdgIiA3UxB h83WwY2IFyIMwIxQwMAF3WAwE=');
hpbar := DTMFromString('mLgAAAHicY2JgYLBjZGAIAuIOIO4E4pZjQL EdDAzsDBDMCMUMDABvpgP4');
qtab := DTMFromString('mbQAAAHicY2VgYEhnYmDIBuI8IE4G4jQgPg MUvwTEp4H4AhAfA+KGyd8YUqv+MXz/ehiOuYDi6JgRCwYDAJvSEkI=');
invtab := DTMFromString('mbQAAAHicY2VgYOhiYmCYDMQTgLgNiFuA+C xQ/AQQXwLiy0B8HIhleFgZkoyFGdxUBMDYTIGTgQsojo4ZsWAwAAD C7gkn');
repeat
ClearDebug;
Chooseproc;
until False;
Freedtm(skelet);
Freedtm(hpbar);
Freedtm(ghost);
Freedtm(druid);
Freedtm(bat);
Freedtm(dwarf);
Freedtm(warewolf);
Freedtm(qtab);
Freedtm(invtab);
end.
Wardancer
12-11-2012, 10:32 PM
I strongly suggest you to make use of case... of statements. They'll make your script much more readable and let you save a lot of time by reducing redundant lines. You should read (or re-read) Coh3n's tutorial: http://villavu.com/forum/showthread.php?t=58935. I don't mean to sound harsh, but it's very painful for the eyes (hard to read).
As for the actual problem with time, it's exactly what I suspected.
PS: You really have a variable called bitch? Please...
I strongly suggest you to make use of case... of statements. They'll make your script much more readable and let you save a lot of time by reducing redundant lines. You should read (or re-read) Coh3n's tutorial: http://villavu.com/forum/showthread.php?t=58935. I don't mean to sound harsh, but it's very painful for the eyes (hard to read).
As for the actual problem with time, it's exactly what I suspected.
PS: You really have a variable called bitch? Please...
Cba to change it because i wrote that break procedure a month ago and use it for my scripts..
Also: its my script i could care less if other people cant read it
Wardancer
12-11-2012, 10:42 PM
I'm not sure you should say, on one hand, that it's your script and you could care less if other people can't read it, and ask for help on the other.
I'm not sure you should say, on one hand, that it's your script and you could care less if other people can't read it, and ask for help on the other.
All you needed was the 2 lines of code.
masterBB
12-11-2012, 11:00 PM
The problem is that the t variable will only hold the integer value. Not the formula. So you will have to call t := GetTimeRunning div 1000+1; every time before the writeln.
program new;
var
t, i: Integer;
begin
t := GetTimeRunning div 1000+1;
for i := 0 to 100 do
begin
wait(100);
t := GetTimeRunning div 1000+1;
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
end;
end.
If you call it every function I suggest to create a procedure.
procedure displayTimeRunning;
var
t: Integer;
begin
t := GetTimeRunning div 1000 + 1;
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
end;
But this will not display what you think it will. Can you adjust it? Pm me if you don't know how to continue. ^^
The problem is that the t variable will only hold the integer value. Not the formula. So you will have to call t := GetTimeRunning div 1000+1; every time before the writeln.
program new;
var
t, i: Integer;
begin
t := GetTimeRunning div 1000+1;
for i := 0 to 100 do
begin
wait(100);
t := GetTimeRunning div 1000+1;
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
end;
end.
If you call it every function I suggest to create a procedure.
procedure displayTimeRunning;
var
t: Integer;
begin
t := GetTimeRunning div 1000 + 1;
Writeln('Time running: ' + IntToStr(Round(t/3600))+ ':' + IntToStr(Round(t/60))+ ':' + IntToStr(Round(t)));
end;
But this will not display what you think it will. Can you adjust it? Pm me if you don't know how to continue. ^^
Thanks working great!
DannyRS
12-12-2012, 12:23 AM
I strongly suggest you to read the includes and try to understand them before posting. You'll learn a lot more this way. There usually is a description of what the procedure or function does.
http://i.imgur.com/W1g5R.jpg
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.