View Full Version : General Stuff
Hobbit
02-28-2013, 04:32 AM
Who:
Hobbit
Ashaman88
DannyRS
Euphemism
J J
Justin
Le Jingle
Olly
Note: You all have edit powers in this section for the purpose of updating To-Do lists and such. Don't abuse it
What:
So we are going to be back porting the SRL-5 include (as a starting point) to work with Old School (2007) Runescape.
Most of the development will be done by you guys. The SRL Developers have access to this section so they may pop in, who knows. I will be acting as more of a project manager, keeping stuff on track, managing the repo and such. Unfortunately I don't have much time for development and actually cannot work on the code without a lot of legal headache (Part of NDA and Assignment Clause I had to sign as part of my internship this semester, long story). So I will be here to guide you along, help with the structure, srl naming conventions stuff like that.
First Steps:
So many of you have done your own separate work here and there getting parts of an '07 include working. I think the first thing we need to do is collaborate what we have already done and get that into the SRL-007 repo so we know where we stand and know where to move forward to.
More stuff might be added here when I think of it. Killer headache right now.
http://i50.tinypic.com/2dqt3rc.png
http://i45.tinypic.com/28ivvh5.png
Some ghetto edits in sps.simba, it works atleast :)
function SPS_Gather07Minimap: TMufasaBitmap;
var
c: TClient;
begin
try
Result := TMufasaBitmap.Create;
Result.SetSize(150, 150);
c := getTClient;
Result.CopyClientToBitmap(
c.IOManager, false, 0, 0, 642-75, 84-75, 642+75, 84+75
);
except
Writeln('SPS_GatherMinimap ERROR: '+ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
// Author: marpis & SRL Community
// Edited by J J for 2007 RS
function SPS_GetRS07Pos(): TPoint;
var
Minimap: TMufasaBitmap;
SmallMap: T3DIntegerArray;
t, FoundMatches: integer;
P: TPoint;
Searches: extended;
begin
Result := Point(-1, -1);
if (not SPS_IsSetup) then
begin
writeln('SPS ERROR: SPS_Setup was never called');
exit;
end;
if (SPS_Tolerance < 1.0) then
SPS_Tolerance := 600.0;
if (SPS_MatchesPercent = 0.0) then
SPS_MatchesPercent := 0.35;
Minimap := SPS_Gather07Minimap();
t := getSystemTime();
SPS_FilterMinimap(Minimap);
//DrawBitmapDebugImg(Minimap.Index);
//DisplayDebugImgWindow(150, 150);
{$IFDEF SIMBAMAJOR990}
SetLength(SmallMap, 0); // Using this instead of SmallMap := [];
SPS_BitmapToMap(Minimap, SPS_Accuracy, SmallMap);
{$ELSE}
SmallMap := [];
SmallMap := SPS_BitmapToMap(Minimap, SPS_Accuracy);
{$ENDIF}
FoundMatches := SPS_FindMapInMap(P.x, P.y, SPS_AreaMaps, SmallMap, SPS_Tolerance);
Searches := ((Minimap.Width / SPS_Accuracy) * (Minimap.Height / SPS_Accuracy));
{
writeln('fx: '+toStr(p.x)+' ~ on area: '+toStr(P.X * SPS_Accuracy + (Minimap.Width / 2)));
writeln('fy: '+toStr(p.y)+' ~ on area: '+toStr(P.Y * SPS_Accuracy + (Minimap.Width / 2)));
writeln('matches: '+toStr(foundMatches));
writeln('searches: '+toStr(searches));
writeln('percent: '+toStr(FoundMatches / Searches));
}
if ((FoundMatches / Searches) > SPS_MatchesPercent) then
Result := SPS_LocalToGlobal(SPS_GetTopLeftCoords(SPS_Areas), // the top left of the total area
P.x * SPS_Accuracy + (Minimap.Width / 2),
P.y * SPS_Accuracy + (Minimap.Width / 2));
Minimap.Free;
t := (GetSystemTime - t);
if (SPS_Debug) then
Writeln('SPS_GetMyPos: Finished in '+ToStr(t)+' ms. Result = '+ToStr(Result));
end;
// Author: marpis & Coh3n
// Walks the path "Path"; always walks to the furthest point possible
// Edited by J J for rs2007.. :)
function SPS_Walk07Path(Path: TPointArray): boolean;
var
I, H, T, D, Fails: integer;
P, MM, MMF: TPoint;
begin
if (not SPS_IsSetup) then
begin
writeln('SPS ERROR: SPS_Setup was never called');
exit;
end;
H := High(Path);
T := GetSystemTime + 20000 + Random(5000);
Fails := 0;
while (not Result) and (GetSystemTime < T) and (Fails < 5) do
begin
P := SPS_GetRS07Pos;
for I := H downto 0 do
begin
MM := Point(642 + Path[I].X - P.X, 84 + Path[I].Y - P.Y)
if MM = MMF then
Inc(Fails);
D := Distance(MM.X, MM.Y, 642, 84);
if (D < 10) then
break
else
if (D < 60) then
begin
if (SPS_MultiMouse) then
MultiMouse(MM.X, MM.Y, 25, 3, false)
else
Mouse(MM.X, MM.Y, 5, 5, mouse_Left);
MMF := MM;
Wait(RandomRange(2000, 4000)); // Wait a bit works fine
T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;
Result := (I = H);
end;
end;
In login.simba, function RSReady needs to be updated or RS07Ready needs to be made.
RS2007 loading ghetto edit in SmartParams.simba
function InitSmart(ForceNew: Boolean): Integer;
var
I, Count: Integer;
IDs: TIntegerArray;
Params: TStringArray;
begin
If (Not ForceNew) then
begin
Ids := SmartGetClientIDs;
Count := Length(IDs);
If (Count > 0) then
For I:= 0 To (Count - 1) Do
begin
If SmartPairClient(IDs[I]) then
begin
Result := IDs[I];
SetEIOSTarget('libsmartremote', ToStr(Result));
Writeln('Paired with SMART[' + ToStr(Result) + ']');
Exit;
end;
end;
end;
Params := GetSmartParams;
If (Length(Params) <> 2) then
begin
Writeln('** Failed To Grab Smart Parameters **');
Writeln('** Please check your internet connection/firewall **');
TerminateScript;
Exit;
end;
{$IFDEF SMART8}
//Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '');
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), 'http://oldschool18.runescape.com/', '/1', 765, 503, 's', '', '');
{$ELSE}
//Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', -1);
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), 'http://oldschool18.runescape.com/', '/j1', 765, 503, 's', '', '', -1);
{$ENDIF}
If (Result > 0) Then
begin
try
SetEIOSTarget('libsmartremote', ToStr(Result));
//Writeln('Loading SMART: ' + Params[0] + Params[1]);
Writeln('Loading SMART 2007');
except
WriteLn('** Fatal Error: Pairing Clients; Terminating Script **');
TerminateScript;
end;
end else
begin
Writeln('** Smart Cannot Spawn Clients **');
TerminateScript;
end;
end;
Small function to click the Pillar in Pinball random
program RandomSolver;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$i P07Include.simba}
// PINBALL
function FindPillar: boolean;
var
i: Integer;
P: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
BoundsBox: TBox;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 1.19);
if FindColorsSpiralTolerance(P07_MSCX, P07_MSCY, TPA, 7914344, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 13) then
begin
writeln('Found pillar colors!');
writeln('TPA Length: ' + IntToStr(Length(TPA)));
SplitTPAWrap(TPA, 15, ATPA);
SortATPASize(ATPA, True);
for i:=0 to high(ATPA) do
begin
writeln('ATPA #' + IntToStr(i) + ': ' + IntToStr(Length(ATPA[i])));
if Length(ATPA[i]) > 100 then
begin
BoundsBox := GetTPABounds(ATPA[i]);
if ((BoundsBox.Y2-BoundsBox.Y1) > 40) and ((BoundsBox.X2-BoundsBox.X1) < 55) then
begin
writeln('Found pillar!');
P := MiddleTPA(ATPA[i]);
MMouse(P.x, P.y, 0, 0);
ClickMouse2(1);
break;
end;
end;
end;
end;
end;
begin
SetupSRL;
SetupP07Include;
SRL_EnableNavBar;
FindPillar;
end.
Ashaman88
02-28-2013, 04:37 PM
Very nice stuff, I think the login stuff is already been pulled by justin on the git. As for the sps, Do we even need to change the function names of get my pos and stuff? Just a thought
Le Jingle
02-28-2013, 05:58 PM
J J;
Here's some stuffs that may or may not help with random NPC's popping up next to player:
program Random_Event_Characters;
const
SECURITY_GUARD = 0;
RICK_TURPENTINE = 1;
GENIE = 2; // needs uptext
MYSTERIOUS_OLD_MAN = 3;
CAPN_PIRATE = 4; // needs uptext
DRUNKEN_DWARF = 5;
DR_JEKYLL = 6;
SANDWICH_LADY = 7;
type
TRandomNPC = record
AppearsTalkingInChat : Boolean;
Count, Diff : Integer;
UpText : string;
Cols, Tols : TIntegerArray;
Hues, Sats : TExtendedArray;
end;
var
RandomNPCs : array of TRandomNPC;
procedure IntData;
begin
SetLength(RandomNPCs, 8);
with RandomNPCs[SECURITY_GUARD] do
begin
SetLength(Cols, 3);
SetLength(Tols, 3);
SetLength(Hues, 3);
SetLength(Sats, 3);
// Dark Clothing, Skin, Army Green clothing
Cols := [2040360, 5799592, 4085341];
Tols := [5, 6, 6];
Hues := [1.12, 0.05, 0.19];
Sats := [2.06, 0.68, 0.13];
Count := 225; // the approx. make-up of NPC
Diff := 50; // plus or minus of the count (accuracy range)
UpText := {Attack }'Security Guard'{ / 3 more options};
end;
with RandomNPCs[RICK_TURPENTINE] do
begin
SetLength(Cols, 4);
SetLength(Tols, 4);
SetLength(Hues, 4);
SetLength(Sats, 4);
// Grey Suit, Purple Cape 1, Purple Cape 2, Skin
Cols := [4537414, 7881587, 4990548, 7839177];
Tols := [9, 9, 6, 6];
Hues := [2.04, 0.51, 0.09, 0.04];
Sats := [0.47, 1.09, 0.26, 1.05];
Count := 200;
Diff := 50;
UpText := {Talk-to }'Rick Turpentine'{ / 2 more options};
end;
with RandomNPCs[GENIE] do // redo proper name
begin
SetLength(Cols, 5);
SetLength(Tols, 5);
SetLength(Hues, 5);
SetLength(Sats, 5);
// Light Blue Skin, Purple pants, Dark Blue Skin, Gold Cuffs, Red Belt
Cols := [15896628, 7474285, 5967112, 953726, 265539];
Tols := [15, 6, 2, 10, 2];
Hues := [0.05, 0.05, 0.05, 0.02, 0.52];
Sats := [0.62, 0.44, 0.62, 0.30, 5.64];
Count := 160;
Diff := 40;
UpText := '';
end;
with RandomNPCs[MYSTERIOUS_OLD_MAN] do
begin
SetLength(Cols, 2);
SetLength(Tols, 2);
SetLength(Hues, 2);
SetLength(Sats, 2);
// Generic (All) robe color, boots
Cols := [2365440, 1835008];
Tols := [2, 0];
Hues := [1.00, 0.00];
Sats := [0.00, 0.00];
Count := 160;
Diff := 40;
UpText := {Talk-to }'Mysterious Old Man'{ / 2 more options};
end;
with RandomNPCs[CAPN_PIRATE] do // redo proper name
begin
SetLength(Cols, 5);
SetLength(Tols, 5);
SetLength(Hues, 5);
SetLength(Sats, 5);
//Red Coat, Boots, Cream Pants, Lanter/Hand, Cap'n Hat
Cols := [3949420, 1647138, 6855087, 4881827, 1387573];
Tols := [12, 5, 10, 4, 9];
Hues := [0.06, 0.00, 0.23, 0.04, 0.16];
Sats := [0.10, 1.34, 1.93, 0.14, 0.92];
Count := 150;
Diff := 50;
UpText := '';
end;
with RandomNPCs[DRUNKEN_DWARF] do
begin
SetLength(Cols, 3);
SetLength(Tols, 3);
SetLength(Hues, 3);
SetLength(Sats, 3);
// Red pants, Beer in hand, Helmet
Cols := [1383526, 3118527, 6645358];
Tols := [13, 8, 12];
Hues := [0.05, 0.02, 0.16];
Sats := [0.51, 2.45, 0.08];
Count := 150;
Diff := 50;
UpText := {Talk-to }'Drunken Dwarf'{ / 2 more options};
end;
with RandomNPCs[DR_JEKYLL] do
begin
SetLength(Cols, 5);
SetLength(Tols, 5);
SetLength(Hues, 5);
SetLength(Sats, 5);
// dark pants, red belt, vest shirt, white shirt (split to grey/white?), bald head
Cols := [1973794, 2615, 3361358, 10724525, 7050176];
Tols := [6, 2, 16, 22, 7];
Hues := [0.00, 0.18, 0.16, 0.08, 0.03];
Sats := [0.82, 0.00, 0.27, 0.10, 1.39];
Count := 225;
Diff := 50;
UpText := {Talk-to }'Dr Jekyll'{ / 2 more options};
end;
with RandomNPCs[SANDWICH_LADY] do
begin
SetLength(Cols, 5);
SetLength(Tols, 5);
SetLength(Hues, 5);
SetLength(Sats, 5);
// Bright pink skirt, medium pink skirt, dark pink skirt, basket tray, white chef hat
Cols := [9410759, 6647452, 5396601, 2318200, 13290192];
Tols := [7, 7, 8, 13, 13];
Hues := [0.06, 0.04, 0.08, 0.17, 0.00];
Sats := [0.57, 0.49, 0.10, 2.13, 0.10];
Count := 225;
Diff := 50;
UpText := {Talk-to }'Sandwich lady'{ / 2 more options};
end;
end;
begin
end.
** Do note that the count's and diff's are verrry general (guesstimates)
Ashaman88
02-28-2013, 06:20 PM
So would it be beneficial for some/one/all of us to have privileges to accept pull requests so we can merge it all more efficiently? Just a thought
Le Jingle
02-28-2013, 06:27 PM
So would it be beneficial for some/one/all of us to have privileges to accept pull requests so we can merge it all more efficiently? Just a thought
I think this would be beneficial too
Hobbit
03-01-2013, 01:14 AM
So would it be beneficial for some/one/all of us to have privileges to accept pull requests so we can merge it all more efficiently? Just a thought
I think this would be beneficial too
Won't happen :) You have to be set as an Owner on the SRL Github account (Not just the repo). Most devs don't even have those privs AFAIK.
Edit: Nvm, there is a dev team that has repo specific privs. For now I think the best way is through pull requests (Mainly so the code can be reviewed). Its not that I dont trust you guys its just anyways easier to catch things (Like missing docs) before its pushed to the repo. I've added the dev team to the SRL-007 repo so if they see a pull request they can check it over and merge. Probably wont ever happen since I seem to do all the merging on the SRL 5 repo already.
Sorry drifted off topic. tl;dr, no not right now, maybe in the future.
Ashaman88
03-01-2013, 01:44 AM
Won't happen :) You have to be set as an Owner on the SRL Github account (Not just the repo). Most devs don't even have those privs AFAIK.
Edit: Nvm, there is a dev team that has repo specific privs. For now I think the best way is through pull requests (Mainly so the code can be reviewed). Its not that I dont trust you guys its just anyways easier to catch things (Like missing docs) before its pushed to the repo. I've added the dev team to the SRL-007 repo so if they see a pull request they can check it over and merge. Probably wont ever happen since I seem to do all the merging on the SRL 5 repo already.
Sorry drifted off topic. tl;dr, no not right now, maybe in the future.
haha alright thanks for the info and for handling all the merges!
DannyRS
03-03-2013, 03:57 PM
StatChars07 with correct 0-9, skills tab and bank/shop numbers etc, was working fine but I'm kinda OCD :)
Ashaman88
03-03-2013, 07:59 PM
StatChars07 with correct 0-9, skills tab and bank/shop numbers etc, was working fine but I'm kinda OCD :)
Sweet :) will need to get those fonts into the official dl.
Hobbit
03-03-2013, 11:02 PM
Wizzup?; can you add these fonts to the font downloader? :)
euphemism
03-03-2013, 11:12 PM
Ashaman88 what's the status on the inventory updating?
Justin
03-03-2013, 11:14 PM
It seems that we are getting close to having this in the SRL Updater, should we look at folder reconstruction while we can (so we don't break any scripts in the future?
Ashaman88
03-03-2013, 11:44 PM
Ashaman88 what's the status on the inventory updating?
It was all done last I checked, I'm not sure if the changed globals messed anything up though
Edit: Just tested them they work fine still
Wizzup?
03-03-2013, 11:51 PM
Wizzup?; can you add these fonts to the font downloader? :)
Send me a mail about this please. I can do it within a few days then.
YoHoJo
03-03-2013, 11:52 PM
Is there a tutorial on how to setup github and do push/pull requests and fork stuff and how to have up to date working SRL07 as well as my own fork of development RS07 version on my comp and allll of that good stuff?
Can someone link me to it?
If not can someone make one, or get on Skype (A.Lakhotia is me) and teach me how to set up all of this Git hubbub properly?
Hobbit
03-03-2013, 11:54 PM
Look under the Git Repo & Tracker sticky, there are tutorial links.
Ashaman88
03-04-2013, 12:31 AM
Just ran a little power chopper and shaft fletcher no issues :)
Looking good
DannyRS
03-04-2013, 12:45 AM
Just ran a little power chopper and shaft fletcher no issues :)
Looking good
Switched off my unof include to this for my bot's a few days back, no issues so far :)
Although on a minor note, in bed on phone atm, but I assume LoginPlayer is missing an, if loggedin then exit;
Because theres an ever so slight pause when it's called, guessing its a wait called regardless of what checks happen, just noticed when starting already logged in, if nobody looks, I'll take a look tomorrow ;)
YoHoJo
03-04-2013, 12:47 AM
Awesome! Glad to see it's very up to date and stable so far.
Going to try and set up git tonight and use it along with developing and pushing stuff!
DannyRS
03-04-2013, 12:50 AM
Awesome! Glad to see it's very up to date and stable so far.
Going to try and set up git tonight and use it along with developing and pushing stuff!
I just unzip it once a day haha, and all git use through the online GUI, not really into command line stuff
Ashaman88
03-04-2013, 02:30 AM
Switched off my unof include to this for my bot's a few days back, no issues so far :)
Although on a minor note, in bed on phone atm, but I assume LoginPlayer is missing an, if loggedin then exit;
Because theres an ever so slight pause when it's called, guessing its a wait called regardless of what checks happen, just noticed when starting already logged in, if nobody looks, I'll take a look tomorrow ;)
There is this at the very beginning of loginplayer, not sure what it is for though?
ActivateClient;
Wait(100);
TypeByte(vk_Escape);
Wait(500);
Also Yohojo I think the main thing left for the include is randoms (besides adding banking locations and extra stuff like that)
DannyRS
03-05-2013, 05:56 PM
Wizzup? Hobbit
The shadow is enabled by default in GetUpText, actually. At least in SRL-5. ;)
Do you guy's have shadows in your UpChars07 ? Should we ?
mine in http://villavu.com/forum/showthread.php?t=96863 do
Totally wasn't stalking Wizzup
Wizzup? Hobbit
Do you guy's have shadows in your UpChars07 ? Should we ?
mine in http://villavu.com/forum/showthread.php?t=96863 do
Totally wasn't stalking Wizzup
http://villavu.com/forum/showthread.php?t=97790 its all done here.
DannyRS
03-05-2013, 06:20 PM
http://villavu.com/forum/showthread.php?t=97790 its all done here.
Ah ty, didn't see you added new font, GJ ;)
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.