Skip to content

Commit

Permalink
Added lodestone interface and mouse click methods.
Browse files Browse the repository at this point in the history
Fixed a bug with ogl.getModels() failing, resulting in many empty
glModels being added to the glModelArray. Now, all models with an ID of
0 will be filtered from the array.

Added mouse.getClick(). This method, returning the string "red" or
"yellow", should be called directly after a mouse click, as it detects
the click textures.

Tweaked combat methods to be more consistent. Removed
combat.hasTarget(ansiString), which returned if the target name
contained ansiString. This was broken due to the combat mash-up and may
be readded in the future.

Added the lodestone interface. Users can now tell if the lodestone
interface is open, click a teleport by passing the name of the location,
and tell if the player is currently teleporting.
  • Loading branch information
ObscuritySRL committed May 8, 2015
1 parent eff1204 commit 29b2fbd
Show file tree
Hide file tree
Showing 5 changed files with 329 additions and 168 deletions.
10 changes: 8 additions & 2 deletions lib/core/core.simba
Expand Up @@ -19,6 +19,7 @@
{$include_once ogLib/lib/interfaces/dialogue.simba}
{$include_once ogLib/lib/interfaces/grandExchange.simba}
{$include_once ogLib/lib/interfaces/inventory.simba}
{$include_once ogLib/lib/interfaces/lodestone.simba}
{$include_once ogLib/lib/interfaces/login.simba}
{$include_once ogLib/lib/interfaces/mainScreen.simba}
{$include_once ogLib/lib/interfaces/minimap.simba}
Expand Down Expand Up @@ -285,11 +286,16 @@ function ogl.getModels():glModelArray;
if funcPointer<>nil then
begin
setLength(result,funcPointerSize);
for funcResultIndex to funcPointerSize-1 do
for 0 to funcPointerSize-1 do
begin
result[funcResultIndex]:=glModel(funcPointer^);
if funcPointer^<>0 then
begin
result[funcResultIndex]:=glModel(funcPointer^);
funcResultIndex:=funcResultIndex+1;
end;
funcPointer:=funcPointer+16;
end;
setLength(result,funcResultIndex);
end;
exit(result);
end;
Expand Down
40 changes: 40 additions & 0 deletions lib/core/mouse.simba
Expand Up @@ -50,6 +50,46 @@ function mouse.getTooltip():string;
exit(result);
end;

function mouse.getClick(funcWait:int32=50):string;
var
funcColourID,
funcID:int32;
funcPointer:pointer;
funcPointerSize:uInt32=0;
funcTimeOut:countDown;
begin
funcTimeOut.setTime(funcWait);
while (result='') and funcTimeOut.timeRemaining() do
begin
funcPointer:=glTextures(funcPointerSize);
if funcPointer<>nil then
begin
for 0 to funcPointerSize div 10 do
begin
case funcID:=funcPointer^ of
3642,7878,8022,2528:
begin
case funcColourID:=(funcPointer+4)^ of
1317122,3292420,592641:
begin
result:='yellow';
break;
end;
else
begin
result:='red';
break;
end;
end;
end;
end;
funcPointer:=funcPointer+36;
end;
end;
end;
exit(result);
end;

function mouse.rightClickOption(funcPoint:tPoint;funcOption:ansiString;funcWait:int32=0):boolean;
var
funcBounds:array[0..1] of tBox=[[2147483647,2147483647,-2147483647,-2147483647],[2147483647,2147483647,-2147483647,-2147483647]];
Expand Down
4 changes: 4 additions & 0 deletions lib/core/type.simba
Expand Up @@ -89,6 +89,10 @@ type inventory=record
__:boolean;
end;

type lodestone=record
__:boolean;
end;

type login=record
__:boolean;
end;
Expand Down

0 comments on commit 29b2fbd

Please sign in to comment.