{$loadlib GLX} {$include_once ogLib/lib/core/type.simba} {$include_once ogLib/lib/core/debug.simba} {$include_once ogLib/lib/core/glFonts.simba} {$include_once ogLib/lib/core/glMapCoords.simba} {$include_once ogLib/lib/core/glMatrices.simba} {$include_once ogLib/lib/core/glModels.simba} {$include_once ogLib/lib/core/glTextures.simba} {$include_once ogLib/lib/core/math.simba} {$include_once ogLib/lib/core/method.simba} {$include_once ogLib/lib/core/mouse.simba} {$include_once ogLib/lib/interfaces/actionBar.simba} {$include_once ogLib/lib/interfaces/bank.simba} {$include_once ogLib/lib/interfaces/chat.simba} {$include_once ogLib/lib/interfaces/combat.simba} {$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} {$include_once ogLib/lib/interfaces/prayer.simba} {$include_once ogLib/lib/interfaces/production.simba} {$include_once ogLib/lib/interfaces/shop.simba} {$include_once ogLib/lib/interfaces/trade.simba} {$include_once ogLib/lib/misc/internals.Simba} {$include_once ogLib/lib/misc/graphics.simba} {$include_once ogLib/lib/misc/smart.simba} function tOGL.callProcedure(funcProcedure:procedure;funcDebug:boolean=true):boolean; begin if @funcProcedure<>nil then begin writeLN(formatDateTime('tt',time()),' | ',ogl.getScriptName(),' > ',replaceRegExpr('procedure\(\)\s\("?([\w]+)[":\w+]*?\)',toStr(@funcProcedure),'$1',true)); funcProcedure(); result:=true; end; exit(result); end; procedure tOGL.debug(funcString:string;funcClear:boolean=false); var funcMessage:string; begin if funcClear then clearDebug(); case length(funcString) of false:funcString:=formatDateTime('tt',time())+' | '+ogl.getScriptName()+' > debug'; true:funcString:=(funcMessage:=formatDateTime('tt',time())+' | '+ogl.getScriptName()+' > ')+'debug'+#13#10+funcMessage+replace(funcString,#13#10,#13#10+funcMessage,[0]); end; writeLN(funcString); end; function tOGL.getAngleTolerance():double; begin exit(oglAngleTolerance);end; function tOGL.getCacheTime():int32; begin exit(oglCacheTime);end; function tOGL.getChars():glCharArray; var funcPointer:^glChar; funcPointerIndex, funcResultIndex:int32; funcPointerSize:uInt32; begin funcPointer:=glFonts(funcPointerSize); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointerIndex=funcPointerSize-1) or (funcPointer^.x-(funcPointer+oglCharSize)^.x<>1) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; end; funcPointer+=oglCharSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getChars(funcTextureID:array of uInt32):glCharArray;overload; var funcPointer:^glChar; funcPointerIndex, funcResultIndex, funcTextureIDIndex:int32; funcPointerSize:uInt32; begin funcPointer:=glFonts(funcPointerSize); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointerIndex=funcPointerSize-1) or (funcPointer^.x-(funcPointer+oglCharSize)^.x<>1) then for funcTextureIDIndex:=0 to high(funcTextureID) do if funcPointer^.textureID=funcTextureID[funcTextureIDIndex] then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; break; end; funcPointer+=oglCharSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getChars(funcTextureID:uInt32):glCharArray;overload; begin exit(self.getChars(tCardinalArray([funcTextureID])));end; function tOGL.getChars(funcTextureID:array of uInt32;funcColour:array of int32):glCharArray;overload; var funcColourIndex, funcPointerIndex, funcResultIndex, funcTextureIDIndex:int32; funcPointer:^glChar; funcPointerSize:uInt32; begin funcPointer:=glFonts(funcPointerSize); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointerIndex=funcPointerSize-1) or (funcPointer^.x-(funcPointer+oglCharSize)^.x<>1) then for funcTextureIDIndex:=0 to high(funcTextureID) do if funcPointer^.textureID=funcTextureID[funcTextureIDIndex] then for funcColourIndex:=0 to high(funcColour) do if similarColors(funcPointer^.colour,funcColour[funcColourIndex],oglColourTolerance) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcTextureIDIndex:=high(funcTextureID); break; end; funcPointer+=oglCharSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getChars(funcTextureID:uInt32;funcColour:int32):glCharArray;overload; begin exit(self.getChars(tCardinalArray([funcTextureID]),[funcColour]));end; function tOGL.getChars(funcTextureID:array of uInt32;funcColour:array of int32;funcBounds:array of tBox):glCharArray;overload; var funcBoundsIndex, funcColourIndex, funcPointerIndex, funcResultIndex, funcTextureIDIndex:int32; funcPointer:^glChar; funcPointerSize:uInt32; begin funcPointer:=glFonts(funcPointerSize); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointerIndex=funcPointerSize-1) or (funcPointer^.x-(funcPointer+oglCharSize)^.x<>1) then for funcTextureIDIndex:=0 to high(funcTextureID) do if funcPointer^.textureID=funcTextureID[funcTextureIDIndex] then for funcColourIndex:=0 to high(funcColour) do if similarColors(funcPointer^.colour,funcColour[funcColourIndex],oglColourTolerance) then for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcTextureIDIndex:=high(funcTextureID); funcColourIndex:=high(funcColour); break; end; funcPointer+=oglCharSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getChars(funcTextureID:uInt32;funcColour:int32;funcBounds:tBox):glCharArray;overload; begin exit(self.getChars(tCardinalArray([funcTextureID]),[funcColour],[funcBounds]));end; function tOGL.getChars(funcTextureID:array of uInt32;funcBounds:array of tBox):glCharArray;overload; var funcBoundsIndex, funcPointerIndex, funcResultIndex, funcTextureIDIndex:int32; funcPointer:^glChar; funcPointerSize:uInt32; begin funcPointer:=glFonts(funcPointerSize); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointerIndex=funcPointerSize-1) or (funcPointer^.x-(funcPointer+oglCharSize)^.x<>1) then for funcTextureIDIndex:=0 to high(funcTextureID) do if funcPointer^.textureID=funcTextureID[funcTextureIDIndex] then for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcTextureIDIndex:=high(funcTextureID); break; end; funcPointer+=oglCharSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getChars(funcTextureID:uInt32;funcBounds:tBox):glCharArray;overload; begin exit(self.getChars(tCardinalArray([funcTextureID]),[funcBounds]));end; function tOGL.getChars(funcBounds:array of tBox):glCharArray;overload; var funcBoundsIndex, funcPointerIndex, funcResultIndex:int32; funcPointer:^glChar; funcPointerSize:uInt32; begin funcPointer:=glFonts(funcPointerSize); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointerIndex=funcPointerSize-1) or (funcPointer^.x-(funcPointer+oglCharSize)^.x<>1) then for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; break; end; funcPointer+=oglCharSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getChars(funcBounds:tBox):glCharArray;overload; begin exit(self.getChars([funcBounds]));end; procedure tOGL.getClientDimensions(var oglClientWidth,oglClientHeight:int32); begin getClientPosition(oglClientWidth,oglClientHeight);end; function tOGL.getClientHeight():int32; begin if (result:=oglClientHeight)=0 then begin getClientPosition(oglClientWidth,oglClientHeight); result:=oglClientHeight; end; exit(result); end; function tOGL.getClientMidPoint():tPoint; begin getClientPosition(oglClientWidth,oglClientHeight); exit(tPoint([oglClientWidth div 2,oglClientHeight div 2])); end; function tOGL.getClientWidth():int32; begin if (result:=oglClientWidth)=0 then begin getClientPosition(oglClientWidth,oglClientHeight); result:=oglClientWidth; end; exit(result); end; function tOGL.getColourCapture():boolean; begin exit(oglColourCapture);end; function tOGL.getColourTolerance():int32; begin exit(oglColourTolerance);end; function tOGL.getControlAutoRetaliate():ansiString; begin exit(oglControlAutoRetaliate);end; function tOGL.getControlFamiliarAction():ansiString; begin exit(oglControlFamiliarAction);end; function tOGL.getControlQuickPrayer():ansiString; begin exit(oglControlQuickPrayer);end; function tOGL.getFontCapture():boolean; begin exit(oglFontCapture);end; function tOGL.getModels():glModelArray; var funcPointer:^glModel; funcPointerSize:uInt32; funcResultIndex:int32; begin funcPointer:=glModels(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin if funcPointer^.id<>0 then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; end; funcPointer+=oglModelSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getModels(funcID:array of uInt32):glModelArray;overload; var funcIDIndex, funcResultIndex:int32; funcPointer:^glModel; funcPointerSize:uInt32; begin funcPointer:=glModels(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; break; end; funcPointer+=oglModelSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getModels(funcID:array of int32):glModelArray;overload; begin exit(self.getModels(tCardinalArray(funcID)));end; function tOGL.getModels(funcID:uInt32):glModelArray;overload; begin exit(self.getModels(tCardinalArray([funcID])));end; function tOGL.getModels(funcID:array of uInt32;funcTID:array of int32):glModelArray;overload; var funcIDIndex, funcResultIndex, funcTIDIndex:int32; funcPointer:^glModel; funcPointerSize:uInt32; begin funcPointer:=glModels(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then for funcTIDIndex:=0 to high(funcTID) do if funcPointer^.tid=funcTID[funcTIDIndex] then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcIDIndex:=high(funcID); break; end; funcPointer+=oglModelSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getModels(funcID:array of int32;funcTID:int32):glModelArray;overload; begin exit(self.getModels(tCardinalArray(funcID),[funcTID]));end; function tOGL.getModels(funcID:uInt32;funcTID:int32):glModelArray;overload; begin exit(self.getModels(tCardinalArray([funcID]),[funcTID]));end; function tOGL.getModels(funcID:array of uInt32;funcTID:array of int32;funcBounds:array of tBox):glModelArray;overload; var funcBoundsIndex, funcIDIndex, funcResultIndex, funcTIDIndex:int32; funcPointer:^glModel; funcPointerSize:uInt32; begin funcPointer:=glModels(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then for funcTIDIndex:=0 to high(funcTID) do if funcPointer^.tid=funcTID[funcTIDIndex] then for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcIDIndex:=high(funcID); funcTIDIndex:=high(funcTID); break; end; funcPointer+=oglModelSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getModels(funcID:array of int32;funcTID:int32;funcBounds:tBox):glModelArray;overload; begin exit(self.getModels(tCardinalArray(funcID),[funcTID],[funcBounds]));end; function tOGL.getModels(funcID:uInt32;funcTID:int32;funcBounds:tBox):glModelArray;overload; begin exit(self.getModels(tCardinalArray([funcID]),[funcTID],[funcBounds]));end; function tOGL.getModels(funcID:array of uInt32;funcBounds:array of tBox):glModelArray;overload; var funcBoundsIndex, funcIDIndex, funcResultIndex:int32; funcPointer:^glModel; funcPointerSize:uInt32; begin funcPointer:=glModels(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcIDIndex:=high(funcID); break; end; funcPointer+=oglModelSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getModels(funcID:array of int32;funcBounds:tBox):glModelArray;overload; begin exit(self.getModels(tCardinalArray(funcID),[funcBounds]));end; function tOGL.getModels(funcID:uInt32;funcBounds:tBox):glModelArray;overload; begin exit(self.getModels(tCardinalArray([funcID]),[funcBounds]));end; function tOGL.getModels(funcBounds:array of tBox):glModelArray;overload; var funcBoundsIndex, funcResultIndex:int32; funcPointer:^glModel; funcPointerSize:uInt32; begin funcPointer:=glModels(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; break; end; funcPointer+=oglModelSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getModels(funcBounds:tBox):glModelArray;overload; begin exit(self.getModels([funcBounds]))end; function tOGL.getScriptName():string; begin if ((result:=oglScriptName)='') and ((result:=(oglScriptName:=replaceRegExpr('(?i)([\w\s\-]+)\.simba',scriptFile,'$1',true)))='') then result:=(oglScriptName:='ogLib'); exit(result); end; function tOGL.getTextures():glTextureArray; var funcPointer:^glTexture; funcPointerSize:uInt32; funcResultIndex:int32; begin funcPointer:=glTextures(funcPointerSize); setLength(result,funcPointerSize); for funcResultIndex to funcPointerSize-1 do begin result[funcResultIndex]:=funcPointer^; funcPointer+=oglTextureSize; end; exit(result); end; function tOGL.getTextures(funcID:array of int32):glTextureArray;overload; var funcIDIndex, funcResultIndex:int32; funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; break; end; funcPointer+=oglTextureSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getTextures(funcID:int32):glTextureArray;overload; begin exit(self.getTextures([funcID]));end; function tOGL.getTextures(funcID,funcColourID:array of int32):glTextureArray;overload; var funcColourIDIndex, funcIDIndex, funcResultIndex:int32; funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then for funcColourIDIndex:=0 to high(funcColourID) do if similarColors(funcPointer^.colourID,funcColourID[funcColourIDIndex],oglColourTolerance) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcIDIndex:=high(funcID); break; end; funcPointer+=oglTextureSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getTextures(funcID,funcColourID:int32):glTextureArray;overload; begin exit(self.getTextures([funcID],[funcColourID]));end; function tOGL.getTextures(funcID,funcColourID:array of int32;funcBounds:array of tBox):glTextureArray;overload; var funcBoundsIndex, funcColourIDIndex, funcIDIndex, funcResultIndex:int32; funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then for funcColourIDIndex:=0 to high(funcColourID) do if similarColors(funcPointer^.colourID,funcColourID[funcColourIDIndex],oglColourTolerance) then for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcIDIndex:=high(funcID); funcColourIDIndex:=high(funcColourID); break; end; funcPointer+=oglTextureSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getTextures(funcID,funcColour:int32;funcBounds:tBox):glTextureArray;overload; begin exit(self.getTextures([funcID],[funcColour],[funcBounds]));end; function tOGL.getTextures(funcID:array of int32;funcBounds:array of tBox):glTextureArray;overload; var funcBoundsIndex, funcIDIndex, funcResultIndex:int32; funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcIDIndex:=0 to high(funcID) do if funcPointer^.id=funcID[funcIDIndex] then for funcBoundsIndex to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; funcIDIndex:=high(funcID); break; end; funcPointer+=oglTextureSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getTextures(funcID:int32;funcBounds:tBox):glTextureArray;overload; begin exit(self.getTextures([funcID],[funcBounds]));end; function tOGL.getTextures(funcBounds:array of tBox):glTextureArray;overload; var funcBoundsIndex, funcResultIndex:int32; funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize); setLength(result,funcPointerSize); for 0 to funcPointerSize-1 do begin for funcBoundsIndex:=0 to high(funcBounds) do if pointInBox([funcPointer^.x,funcPointer^.y],funcBounds[funcBoundsIndex]) then begin result[funcResultIndex]:=funcPointer^; funcResultIndex+=1; break; end; funcPointer+=oglTextureSize; end; setLength(result,funcResultIndex); exit(result); end; function tOGL.getTextures(funcBounds:tBox):glTextureArray;overload; begin exit(self.getTextures([funcBounds]));end; function tOGL.getXP(skill: string): integer; var i, skillID: uint32; skillTextures: glTextureArray; skillBoxTexture: glTexture; skillBox: TBox; begin case lowercase(skill) of 'attack': skillID := 16918; 'strength': skillID := 39319; 'defence': skillID := 41952; 'range': skillID := 20999; 'magic': skillID := 51211; 'constitution': skillID := 38262; 'thieving': skillID := 25506; 'crafting': skillID := 33559; 'fletching': skillID := 19315; 'mining': skillID := 16653; 'smithing': skillID := 31773; 'fishing': skillID := 54626; 'runecrafting': skillID := 33877; 'slayer': skillID := 64733; 'farming': skillID := 34536; 'construction': skillID := 54189; 'hunter': skillID := 30306; 'summoning': skillID := 37582; 'prayer': skillID := 23912; 'agility': skillID := 29580; 'herblore': skillID := 54427; 'cooking': skillID := 47376; 'firemaking': skillID := 46008; 'woodcutting': skillID := 44243; 'dungeoneering': skillID := 58390; 'divination': skillID := 22933; 'combat': skillID := 31110; 'overall': skillID := 48705; end; skillTextures := ogl.getTextures(skillID); if skillTextures.isEmpty() then exit(result - 1); skillBoxTexture := skillTextures[low(skillTextures)]; skillBox := skillBoxTexture.bounds.adjustPosition( - 150, 0, 0, 0); result := explode('+', ogl.getChars(skillBox).toString())[0].parseInt(); end; function tOGL.getTimeout():uInt32; begin exit(oglTimeout);end; function tOGL.getUpTime():string; begin exit(formatDateTime('tt',getTimeRunning()/100000000));end; procedure tOGL.save(); begin tOGL.getClientDimensions(oglClientWidth,oglClientHeight); writeINI('default','oglAngleTolerance',toStr(oglAngleTolerance),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglCacheTime',toStr(oglCacheTime),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglColourCapture',toStr(oglColourCapture),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglColourTolerance',toStr(oglColourTolerance),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglControlAutoRetaliate',oglControlAutoRetaliate,'includes/ogLib/lib/core/core.ini'); writeINI('default','oglControlFamiliarAction',oglControlFamiliarAction,'includes/ogLib/lib/core/core.ini'); writeINI('default','oglControlQuickPrayer',oglControlQuickPrayer,'includes/ogLib/lib/core/core.ini'); writeINI('default','oglClientHeight',toStr(oglClientHeight),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglClientWidth',toStr(oglClientWidth),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglFontCapture',toStr(oglFontCapture),'includes/ogLib/lib/core/core.ini'); writeINI('default','oglTimeout',toStr(oglTimeout),'includes/ogLib/lib/core/core.ini'); end; function tOGL.setAngleTolerance(funcAngleTolerance:double):double; begin exit(oglAngleTolerance:=funcAngleTolerance);end; function tOGL.setCacheTime(funcCacheTime:int32):int32; begin exit(oglCacheTime:=funcCacheTime);end; function tOGL.setColourCapture(funcEnable:boolean):boolean; begin if glxSetColourCapture(funcEnable) then result:=(oglColourCapture:=funcEnable) else result:=oglColourCapture; exit(result); end; function tOGL.setColourTolerance(funcColourTolerance:int32):int32; begin exit(oglColourTolerance:=funcColourTolerance);end; function tOGL.setControlAutoRetaliate(funcControlAutoRetaliate:ansiString):ansiString; begin exit(oglControlAutoRetaliate:=funcControlAutoRetaliate);end; function tOGL.setControlFamiliarAction(funcControlFamiliarAction:ansiString):ansiString; begin exit(oglControlFamiliarAction:=funcControlFamiliarAction);end; function tOGL.setControlQuickPrayer(funcControlQuickPrayer:ansiString):ansiString; begin exit(oglControlQuickPrayer:=funcControlQuickPrayer);end; function tOGL.setDefaultAngleTolerance(funcAngleTolerance:int32):double; begin writeINI('default','oglAngleTolerance',toStr(funcAngleTolerance),'includes/ogLib/lib/core/core.ini'); exit(oglAngleTolerance:=funcAngleTolerance); end; function tOGL.setDefaultCacheTime(funcCacheTime:int32):int32; begin writeINI('default','oglCacheTime',toStr(funcCacheTime),'includes/ogLib/lib/core/core.ini'); exit(oglCacheTime:=funcCacheTime); end; function tOGL.setDefaultClientHeight(funcClientHeight:int32):int32; begin writeINI('default','oglClientHeight',toStr(funcClientHeight),'includes/ogLib/lib/core/core.ini'); exit(funcClientHeight); end; function tOGL.setDefaultClientWidth(funcClientWidth:int32):int32; begin writeINI('default','oglClientWidth',toStr(funcClientWidth),'includes/ogLib/lib/core/core.ini'); exit(funcClientWidth); end; function tOGL.setDefaultColourCapture(funcEnable:boolean):boolean; begin if glxSetColourCapture(funcEnable) then begin result:=(oglColourCapture:=funcEnable); writeINI('default','oglColourCapture',toStr(funcEnable),'includes/ogLib/lib/core/core.ini'); end else result:=oglColourCapture; exit(result); end; function tOGL.setDefaultColourTolerance(funcColourTolerance:int32):int32; begin writeINI('default','oglColourTolerance',toStr(funcColourTolerance),'includes/ogLib/lib/core/core.ini'); exit(oglColourTolerance:=funcColourTolerance); end; function tOGL.setDefaultControlAutoRetaliate(funcControlAutoRetaliate:ansiString):ansiString; begin writeINI('default','oglControlAutoRetaliate',funcControlAutoRetaliate,'includes/ogLib/lib/core/core.ini'); exit(oglControlAutoRetaliate:=funcControlAutoRetaliate); end; function tOGL.setDefaultControlFamiliarAction(funcControlFamiliarAction:ansiString):ansiString; begin writeINI('default','oglControlFamiliarAction',funcControlFamiliarAction,'includes/ogLib/lib/core/core.ini'); exit(oglControlFamiliarAction:=funcControlFamiliarAction); end; function tOGL.setDefaultControlQuickPrayer(funcControlQuickPrayer:ansiString):ansiString; begin writeINI('default','oglControlQuickPrayer',funcControlQuickPrayer,'includes/ogLib/lib/core/core.ini'); exit(oglControlQuickPrayer:=funcControlQuickPrayer); end; function tOGL.setDefaultFontCapture(funcEnable:boolean):boolean; begin if glxSetFontCapture(funcEnable) then begin result:=(oglFontCapture:=funcEnable); writeINI('default','oglFontCapture',toStr(funcEnable),'includes/ogLib/lib/core/core.ini'); end else result:=oglFontCapture; exit(result); end; function tOGL.setDefaultTimeout(funcTimeout:uInt32):uInt32; begin writeINI('default','oglTimeout',toStr(funcTimeout),'includes/ogLib/lib/core/core.ini'); exit(oglTimeout:=funcTimeout); end; function tOGL.setFontCapture(funcEnable:boolean):boolean; begin if glxSetFontCapture(oglFontCapture:=funcEnable) then result:=(oglFontCapture:=funcEnable) else result:=oglFontCapture; exit(result); end; function tOGL.setTimeout(funcTimeout:uInt32):uInt32; begin glxSetTimeout(funcTimeout); exit(oglTimeout:=funcTimeout); end; procedure ogl.setMapHooks(funcDimensions:array[0..1] of int32); begin smart.create(funcDimensions[0],funcDimensions[1]); glxMapHooks(smart.pid); end; function tOGL.setup(funcDimensions:array[0..1] of int32=[0,0];funcViewPort:array[0..3] of int32=[0,0,0,0]):boolean; begin clearDebug(); writeLN(formatDateTime('tt',time()),' | ',self.getScriptName(),' > setup'); if funcDimensions[0]=0 then funcDimensions[0]:=strToInt(replaceRegExpr('^$',readINI('Default','oglClientHeight','includes/ogLib/lib/core/core.ini'),'600',false)); if funcDimensions[1]=0 then funcDimensions[1]:=strToInt(replaceRegExpr('^$',readINI('Default','oglClientWidth','includes/ogLib/lib/core/core.ini'),'800',false)); oglAngleTolerance:=strToFloat(replaceRegExpr('^$',readINI('Default','oglAngleTolerance','includes/ogLib/lib/core/core.ini'),'0.26179938779914943653855361527335',false)); oglCacheTime:=strToInt(replaceRegExpr('^$',readINI('Default','oglCacheTime','includes/ogLib/lib/core/core.ini'),'150',false)); oglColourTolerance:=strToInt(replaceRegExpr('^$',readINI('Default','oglColourTolerance','includes/ogLib/lib/core/core.ini'),'4',false)); oglControlAutoRetaliate:=replaceRegExpr('^$',readINI('Default','oglControlAutoRetaliate','includes/ogLib/lib/core/core.ini'),'',false); oglControlFamiliarAction:=replaceRegExpr('^$',readINI('Default','oglControlFamiliarAction','includes/ogLib/lib/core/core.ini'),'',false); oglControlQuickPrayer:=replaceRegExpr('^$',readINI('Default','oglControlQuickPrayer','includes/ogLib/lib/core/core.ini'),'',false); oglColourCapture:=strToBool(replaceRegExpr('^$',readINI('Default','oglColourCapture','includes/ogLib/lib/core/core.ini'),'True',false)); oglFontCapture:=strToBool(replaceRegExpr('^$',readINI('Default','oglFontCapture','includes/ogLib/lib/core/core.ini'),'True',false)); oglTimeout:=strToInt(replaceRegExpr('^$',readINI('Default','oglTimeout','includes/ogLib/lib/core/core.ini'),'2000',false)); self.setMapHooks(funcDimensions); getClientPosition(oglClientWidth,oglClientHeight); self.setColourCapture(oglColourCapture); self.setFontCapture(false); self.setTimeout(oglTimeout); self.setViewPort(funcViewPort[0],funcViewPort[1],funcViewPort[2],funcViewPort[3]); exit(true); end; function tOGL.setup(funcWidth,funcHeight:int32):boolean;overload; begin self.setup([funcWidth,funcHeight]); end; function ogl.setViewPort(funcX1,funcY1,funcX2,funcY2:int32):boolean; begin exit(glxViewPort(funcX1,funcY1,funcX2,funcY2));end;