View Full Version : Help with reports/proggy's
Gucci
02-22-2012, 12:41 AM
Hi, so i'm back (lol) and I can't seem to get reports working right, could someone make a guide for these or direct me too one?
Here is an example of one of mine ( the xp counter doesn't work):
procedure Report;
var
IvyChopped: integer;
TotalEXP: integer;
begin
TotalEXP := (IvyChopped*333);
Writeln('############ MegaIvyChopper ##########');
Writeln('|= Player : ' + Players[CurrentPlayer].Name);
Writeln('|= Time Running : ' + TimeRunning);
Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
Writeln('######################################');
end;
Thank you for any help and guidance.
Runaway
02-22-2012, 12:51 AM
Looks like it's an issue with your counter, not your report. Everything seems fine on the report :o
Gucci
02-22-2012, 12:53 AM
But how come it's not working ;(
Runaway
02-22-2012, 01:20 AM
But how come it's not working ;(
I will never be able to answer with the limited amount of code you posted :P
poopy2177
02-22-2012, 01:40 AM
If InvCount = +1 then IncEx(IvyChopped,1);
make sure you have somthing like that in your script
PatDuffy
02-22-2012, 01:45 AM
If InvCount = +1 then IncEx(IvyChopped,1);
make sure you have somthing like that in your script
You can't use InvCount for Ivy, you will have to use the xp-bar or create something with the new xp animation.
Gucci
02-22-2012, 01:50 AM
Code: Ignore the DTM parts I can't get those to work yet
program MegaIvyChopper;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
const
SRLStats_User = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NumbOfPlayers = 1;
StartPlayer = 0;
var
IvyChopped, Ivy, TotalEXP, x, y: integer;
aFound: Extended;
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];
With Players[0] do
begin
Name := ''; //Username.
Pass := ''; //Password.
Active := True;
end;
end;
function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 6, 6);
If WaitUpText(UpText, 1000+Random(200)) Then
begin
Result:=True;
GetMousePos(x, y);
If RClick Then
begin
Mouse(x, y, 0, 0, False);
Result:= WaitOption(Option, 2000);
If Result Then FFlag(0);
end Else
Begin
Mouse(x, y, 0, 0, True);
Wait(150+Random(100));
FFlag(0);
end;
end;
end;
Function Cutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(250, 132, 279, 193);
Result := (AveragePixelShift(PBox, 500, 800) > 425);
end;
function BirdNest: Boolean;
var
i, x, y: integer;
begin
if (Pos('A bird', GetChatBoxText(i, 255))<>0) then // Credit to Shuttleu for this line
begin
WriteLn('Found a Bird Nest');
if FindObjCustom(x, y, ['ake Bird Nest', 'bird', 'nest'], [2767422, 2961972, 3818051], 10) then
Mouse(x, y, 5, 5, True);
end;
end;
procedure SetDTM;
begin
Ivy := DTMFromString('mrAAAAHic42BgYDgKxMeBeDcQnwTia0B8FY gPAPFGIK4B4nwo3QbE1UCcAMTzgbgDiMtmhjGEF9gzBGXZMHjF mzHEVbkwxFY4M2Ql2jAk1LgxEAKMBDAMAACfGxLL');
end;
procedure Report;
var
IvyChopped: integer;
TotalEXP: integer;
begin
TotalEXP := (IvyChopped*333);
Writeln('############ MegaIvyChopper ##########');
Writeln('|= Player : ' + Players[CurrentPlayer].Name);
Writeln('|= Time Running : ' + TimeRunning);
Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
Writeln('######################################');
end;
procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(2) of
0:
begin
WriteLn('AntiBan Is Being Performed');
HoverSkill('Woodcutting', false);
wait(2500+Random(1000));
Mouse(659, 189, 0, 0, True);
end;
1:
begin
WriteLn('Bored')
If (Cutting) then
BoredHuman;
end;
end;
end;
procedure CrashSMART;
begin
Writeln('You are using CRASHSMART, so we are going to reload your client after the RS update!');
SmartgetFieldObject(1488,'crash');
Wait(5000);
WriteLn('CRASHSMART Failed: Make sure you are using the custom libsmart plugin');
TerminateScript;
end;
procedure FreDTM;
begin
FreeDTM(Ivy);
end;
procedure IvyChopping;
begin
SetDTM;
MakeCompass('N');
SetAngle(SRL_ANGLE_LOW);
wait(200+random(400));
if (FindDTMRotated(Ivy, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)) then
begin
Writeln('Ivy Has Been Found :)');
Wait(10+random(20));
Mouse(x,y,4,4,true)
Wait(10+random(45));
if (Cutting) then
Antiban;
end else Writeln('Cannot find Ivy');
repeat
wait(50+random(100));
Until(Not Cutting);
end;
procedure FailSafe (Reason:String);
begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
TerminateScript;
end;
begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
ActivateClient;
Smart_Server := 30;
SetupSRL;
SetDTM;
SRL_Procs[srl_OnRSUpdate] := @CrashSMART;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
wait(1000+random(400));
Repeat
IvyChopping;
BirdNest;
AntiBan;
Report;
FreDTM;
Until(false);
end.
Gucci
02-22-2012, 01:52 AM
You can't use InvCount for Ivy, you will have to use the xp-bar or create something with the new xp animation.
OMG way too advanced for me :confused:
Gucci
02-22-2012, 02:27 AM
anyone?
Runaway
02-22-2012, 03:20 AM
Ok, the first issue is that you've declared IvyChopped twice. You want to use that integer globally, so remove it from here:
procedure Report;
var
IvyChopped: integer;
TotalEXP: integer;
Second, you declare it but never give it a value. Normally you would give it a value by using the Inc() function which increases a variables value by 1, but with an ivy chopper that won't work.
What you can do is use the function CountItems() which can search for an item in your inventory and return the amount of that item there is (very useful for counting stackables).
Simply search at the beginning and store the value, then search during the report procedure and subtract the first value from the second. if you can't find the DTM then assume the value began is 0.
Hopefully that helps :)
Gucci
02-22-2012, 05:17 AM
Ok, the first issue is that you've declared IvyChopped twice. You want to use that integer globally, so remove it from here:
procedure Report;
var
IvyChopped: integer;
TotalEXP: integer;
Second, you declare it but never give it a value. Normally you would give it a value by using the Inc() function which increases a variables value by 1, but with an ivy chopper that won't work.
What you can do is use the function CountItems() which can search for an item in your inventory and return the amount of that item there is (very useful for counting stackables).
Simply search at the beginning and store the value, then search during the report procedure and subtract the first value from the second. if you can't find the DTM then assume the value began is 0.
Hopefully that helps :)
But ivy doesn't go into the inventory when chopped
Runaway
02-22-2012, 07:17 AM
But ivy doesn't go into the inventory when chopped
Well that was silly of me. I assumed it was a stackable item you'd be measuring :p
What you can do instead is:
var
StartXp: integer; // Add this var to your globals declared at the top
...
// Place this somewhere at the beginning of the script
StartXp := GetXpBar(1);
// I am not entirely sure what integer is used in the GetXpBar() function as
// I've never used it, but if 1 does not work try tinkering with the value.
...
procedure Report;
var
TotalEXP, CurrentXp: integer;
begin
CurrentXp := GetXpBar(1);
TotalEXP := (CurrentXp - StartXp);
Writeln('############ MegaIvyChopper ##########');
Writeln('|= Player : ' + Players[CurrentPlayer].Name);
Writeln('|= Time Running : ' + TimeRunning);
Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
Writeln('######################################');
end;
This function will take the value of your Xp bar in the top right corner of the RS interface and store it in the StartXp variable. Then you can get the total amount of Xp gained by subtracting that from the current integer displayed on the Xp bar.
Gucci
02-22-2012, 11:31 PM
Thanks for helping
Runaway
02-22-2012, 11:45 PM
No problem, happy to help :)
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.