alw98
2013-06-17 11:31:33
Alright, I know this is a stupid question, but for the life of me I cannot figure out how to set a boolean to true or false. Help!
2013-06-17 11:31:33
2013-06-17 11:42:07
2013-06-17 11:44:15
From: alw98
Alright, I know this is a stupid question, but for the life of me I cannot figure out how to set a boolean to true or false. Help!
function booleanReturn: boolean;
begin
if(somethingHappened)then
Result:= True;//defaults to false all the time, so no need to set to false.
end;
2013-06-17 12:11:53
procedure Startup;
begin;
if loot:=0 then
waitt:= true
end;
procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, COLOR, 0, 0, w-1, h-1)then
colorpresent:=true
if waitt:=true
begin
loot := (loot + 1);
Mouse(x, y, 0, 0, True);
Writeln('Silk Found!');
waitt:=false
wait until;
colorpresent:=false then
waitt:=true
end else
wait(100);
end;
2013-06-17 12:23:56
procedure Startup;
begin//no semicolon after a begin
if (loot=0) then//If checks are if(var=something). Use '=' and not ':=' in if
waitt:= true;//This should have a semicolon, and where are loot and waitt declared?
end;
procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);//I'm assuming this is for a RSPS and not base runescape, otherwise there are better and simpler ways to solve this portion.
if FindColor(x, y, COLOR, 0, 0, w-1, h-1)then
colorpresent:=true//Where is this declared?
if (waitt=true)
begin
loot := (loot + 1);
Mouse(x, y, 0, 0, True);
Writeln('Silk Found!');
waitt:=false
wait until;//What are you trying to wait for? this is gonna break since you don't have anything. I'll write something in the next code section for an example.
colorpresent:=false then//You can't use then without an if. Idk your goal here.
waitt:=true
end else
wait(100);
end;
procedure waitTillNotMoving;
var
ttime: integer;
begin
MarkTime(ttime);
repeat
wait(randomRange(50,100));
until((not IsMoving) or (TimeFromMark(ttime) > 5000));//IsMoving is a boolean that says whether you're currently moving in RS. The time from mark makes sure we don't wait more than 5 seconds as a failsafe if ismoving doesn't ever say false. ALWAYS include failsafes.
end;
2013-06-17 12:35:58
program SilkStealer;
{$i srl\srl.simba}
const
COLOR = 000; //replace 000 with the numbers you get for each stall.
AMOUNT = 000; //replace 000 with the amount gained from when you steal from the stall
var
loot, money :Integer;
waitt, colorpresent :Boolean;
procedure Startup; //***********From Here
begin//no semicolon after a begin
if (loot=0) then//If checks are if(var=something). Use '=' and not ':=' in if
waitt:= true;//This should have a semicolon, and where are loot and waitt declared?
end;
procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);//I'm assuming this is for a RSPS and not base runescape, otherwise there are better and simpler ways to solve this portion.
if FindColor(x, y, COLOR, 0, 0, w-1, h-1)then
if (waitt=true)
begin
loot := (loot + 1);
Mouse(x, y, 0, 0, True);
Writeln('Silk Found!');
waitt:=false;
repeat
if FindColor(x, y, COLOR, 0, 0, w-1, h-1)then
colorpresent:= true; //You can't use then without an if. Idk your goal here.
else
colorpresent:= false;
until (not colorpresent);
waitt:=true;
end else
wait(100);
end;//************* To Here
procedure Proggy;
begin
Writeln('');
Writeln('********************************');
Writeln('Thanks for using my script!');
Writeln('We have stolen: ' + IntToStr(loot) + ' loot');
Writeln('We have stolen: ' + IntToStr(money) + ' money');
Writeln('********************************');
Writeln('Much credit to abu_jwka for helping me script most of it!')
Writeln('');
end;
begin
ClearDebug;
SetUpSRL;
AddOnTerminate('Proggy');
repeat
ClearDebug;
StealSilk;
money := (loot * AMOUNT);
until (IsKeyDown(114)); //pres F3 to stop and continue to Proggie!
end. 2013-06-17 12:58:20
if FindColor(x, y, COLOR, MSX1, MSY1, MSX2, MSY2)then//this will even limit it to the main screen so you don't search the minimap or inventory or chat bars.
2013-06-17 13:02:03
2013-06-17 13:17:55
procedure StealSilk;
var
x, y, w, h: integer;
begin
GetClientDimensions(w, h);
if FindColor(x, y, COLOR, 0, 0, w - 1, h - 1) then
if waitT then
begin
loot := (loot + 1);
Mouse(x, y, 0, 0, True);
Writeln('Silk Found!');
waitt := false;
repeat
if FindColor(x, y, COLOR, 0, 0, w - 1, h - 1) then
begin
colorpresent := true;
end else
colorpresent := false;
until (not colorpresent);
waitt := true;
end
else
wait(100);
end;