SRL Archive - OSR Help

LF a lil DEMO on proggys


deadone001

2012-03-10 12:45:24

First let me start off by saying i just started scripting yesterday stayed up for about 12 hours or so and got my first script done :), any help you offer would be very appreciated. I would like permission to use a progress report that someone posts in this thread :o. I admit I could just open a script and take one, I dont wanna do it that way i would like someone to post one here so I can ask questions on it. Would like to include a description of a few things as well. I know how to add a clock that works i would like an explanation on increments(Inc), and would also like to know if it would be possible to do math in a script then show that number in a proggy, like x being your incremented variable multiplied by a set integer such as 10 then subtracted by another number such as (x-10x).
So (10x-76x)
Lastly i would like to know if there is a way to draw on XPGained during the running of the script because I'm doing something that is random in XP, and therefore cant use a base number of Xp like for say chopping a tree.

I realize this is a ton to ask of someone and not everyone would be inclined to answer I would be eternally grateful and will continue scripting siting your help specifically in my first few works.(I'm making like 600-800k an hour with this first one and don't really want it getting ruined.)

Jagex_Fagex

2012-03-10 13:54:13

For a start, this isn't a tutorial, so this shouldn't be in this section.

Here is my progress report from my Iron Miner:


Procedure ProgressReport;
var
hh, mm, ss: Integer;
begin
ConvertTime(TimeFromMark(CharRun), hh, mm, ss);
Writeln(' ');
Writeln(' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ');
Writeln(' |J|a|g|e|x|_|F|a|g|e|x| |S|c|r|i|p|t|i|n|g| ');
Writeln(' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ');
Writeln('Presents '+SCRIPT_NAME+' v '+SCRIPT_VERSION+'!');
Writeln(' ');
Writeln(' Total running time - '+TimeRunning);
Writeln(' Current Player - '+ Players[CurrentPlayer].Name);
Writeln(' This player running time - '+intToStr(hh)+' Hours, '+intToStr(mm)+' Minutes, '+intToStr(ss)+' Seconds');
Writeln(' Iron Ore mined - '+intToStr(Players[CurrentPlayer].Integers[8]));
Writeln(' Total loads complete - '+intToStr(loadsComplete));
Writeln(' Total Exp gained - '+intToStr(Players[CurrentPlayer].Integers[8]*ironExp));
Stats_Commit;
end;


As you can see, you can easily do maths in it. I use maths to work out EXP gained.

deadone001

2012-03-10 17:31:22

thanks alot and i couldnt find the "help section" new to these forums as well :o

LordJashin

2012-03-12 11:07:32

From: Jagex_Fagex
For a start, this isn't a tutorial, so this shouldn't be in this section.

Here is my progress report from my Iron Miner:


Procedure ProgressReport;
var
hh, mm, ss: Integer;
begin
ConvertTime(TimeFromMark(CharRun), hh, mm, ss);
Writeln(' ');
Writeln(' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ');
Writeln(' |J|a|g|e|x|_|F|a|g|e|x| |S|c|r|i|p|t|i|n|g| ');
Writeln(' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ');
Writeln('Presents '+SCRIPT_NAME+' v '+SCRIPT_VERSION+'!');
Writeln(' ');
Writeln(' Total running time - '+TimeRunning);
Writeln(' Current Player - '+ Players[CurrentPlayer].Name);
Writeln(' This player running time - '+intToStr(hh)+' Hours, '+intToStr(mm)+' Minutes, '+intToStr(ss)+' Seconds');
Writeln(' Iron Ore mined - '+intToStr(Players[CurrentPlayer].Integers[8]));
Writeln(' Total loads complete - '+intToStr(loadsComplete));
Writeln(' Total Exp gained - '+intToStr(Players[CurrentPlayer].Integers[8]*ironExp));
Stats_Commit;
end;


As you can see, you can easily do maths in it. I use maths to work out EXP gained.


You could do the same thing with this

procedure WritelnEx(str : string);
begin
str := Replace(str, '\n', #13#10, [rfReplaceAll]);
Writeln(str);
end;

WritelnEx('lalalalalalaalalaalal\n' +
'NEW LINE woot');

Tons of tuts in here - http://villavu.com/forum/showthread.php?t=76632