{ ======================================== EXAMPLES: ---------------------------------------- (* DESCRIPTION: The ID 119085 belongs to all summoning pouches. *) inventory.clickItem(119085); ======================================== } function tInventory.clickItem(funcID:int32):boolean; var funcPointer:pointer; funcPointerIndex, funcPointerSize, funcSlotIndex:uInt32=0; funcX, funcY:int32; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcSlotIndex:=funcSlotIndex+1 else if funcSlotIndex<>0 then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if funcPointer^=funcID then begin clickMouse(random((funcX:=(funcPointer+12)^)-15,funcX+15),random((funcY:=(funcPointer+16)^)-15,funcY+15),1); result:=true; break; end; funcPointer:=funcPointer+36; end; exit(result); end; function tInventory.clickItem(funcID:array of int32):boolean;overload; var funcContinue:boolean; funcPointer:pointer; funcIDIndex, funcPointerIndex, funcPointerSize:uInt32=0; funcX, funcY:int32; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex<>funcPointerSize then for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break; for funcIDIndex:=0 to high(funcID) do begin if funcPointer^=funcID[funcIDIndex] then begin clickMouse(random((funcX:=(funcPointer+12)^)-15,funcX+15),random((funcY:=(funcPointer+16)^)-15,funcY+15),1); result:=true; break; end; end; if result then break; funcPointer:=funcPointer+36; end; exit(result); end; function tInventory.clickItem(funcID,funcColourID:int32):boolean;overload; var funcPointer:pointer; funcPointerIndex, funcPointerSize, funcSlotIndex:uInt32=0; funcX, funcY:int32; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcSlotIndex:=funcSlotIndex+1 else if funcSlotIndex<>0 then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if (funcPointer^=funcID) and similarColors((funcPointer+4)^,funcColourID,oglColourTolerance) then begin clickMouse(random((funcX:=(funcPointer+12)^)-15,funcX+15),random((funcY:=(funcPointer+16)^)-15,funcY+15),1); result:=true; break; end; funcPointer:=funcPointer+36; end; exit(result); end; function tInventory.clickItem(funcID,funcColourID:array of int32):boolean;overload; var funcContinue:boolean; funcPointer:pointer; funcColourIDIndex, funcIDIndex, funcPointerIndex, funcPointerSize:uInt32=0; funcX, funcY:int32; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break; for funcIDIndex:=0 to high(funcID) do begin if funcPointer^=funcID[funcIDIndex] then for funcColourIDIndex:=0 to high(funcColourID) do if similarColors((funcPointer+4)^,funcColourID[funcColourIDIndex],oglColourTolerance) then begin clickMouse(random((funcX:=(funcPointer+12)^)-15,funcX+15),random((funcY:=(funcPointer+16)^)-15,funcY+15),1); result:=true; break; end; if result then break; end; if result then break; funcPointer:=funcPointer+36; end; exit(result); end; { ======================================== EXAMPLES: ---------------------------------------- (* DESCRIPTION: The ID 119085 belongs to all summoning pouches. *) __item:=tInventory.getItem(119085); if __item.id<>0 then clickMouse(__item.x,__item.y,1); ======================================== } function tInventory.getItem(funcID:int32):glTexture; var funcContinue:boolean; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if funcPointer^=funcID then begin result:=glTexture(funcPointer^); break; end; funcPointer:=funcPointer+36; end; exit(result); end; function tInventory.getItem(funcID:array of int32):glTexture;overload; var funcContinue:boolean; funcPointer:pointer; funcIDIndex, funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break; for funcIDIndex:=0 to high(funcID) do begin if funcPointer^=funcID[funcIDIndex] then begin result:=glTexture(funcPointer^); break; end; end; funcPointer:=funcPointer+36; end; exit(result); end; function tInventory.getItem(funcID,funcColourID:int32):glTexture;overload; var funcContinue:boolean; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if (funcPointer^=funcID) and similarColors((funcPointer+4)^,funcColourID,oglColourTolerance) then begin result:=glTexture(funcPointer^); break; end; funcPointer:=funcPointer+36; end; exit(result); end; function tInventory.getItems(funcID:int32):glTextureArray; var funcContinue:boolean; funcPointer:pointer; funcPointerIndex, funcPointerSize, funcResultIndex:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if (funcPointer^=funcID) and (abs(0+(funcPointer+20)^-(funcPointer+28)^)>1) and (abs(0+(funcPointer+24)^-(funcPointer+32)^)>1) then begin result[funcResultIndex]:=glTexture(funcPointer^); funcResultIndex:=funcResultIndex+1; end; funcPointer:=funcPointer+36; end; setLength(result,funcResultIndex); exit(result); end; function tInventory.getItems(funcID:array of int32):glTextureArray;overload; var funcContinue:boolean; funcPointer:pointer; funcIDIndex, funcPointerIndex, funcPointerSize, funcResultIndex:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break; for funcIDIndex:=0 to high(funcID) do begin if (funcPointer^=funcID[funcIDIndex]) and (abs(0+(funcPointer+20)^-(funcPointer+28)^)>1) and (abs(0+(funcPointer+24)^-(funcPointer+32)^)>1) then begin result[funcResultIndex]:=glTexture(funcPointer^); funcResultIndex:=funcResultIndex+1; break; end; end; funcPointer:=funcPointer+36; end; setLength(result,funcResultIndex); exit(result); end; function tInventory.getItems(funcID,funcColourID:int32):glTextureArray;overload; var funcContinue:boolean; funcPointer:pointer; funcPointerIndex, funcPointerSize, funcResultIndex:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if (funcPointer^=funcID) and similarColors((funcPointer+4)^,funcColourID,oglColourTolerance) and (abs(0+(funcPointer+20)^-(funcPointer+28)^)>1) and (abs(0+(funcPointer+24)^-(funcPointer+32)^)>1) then begin result[funcResultIndex]:=glTexture(funcPointer^); funcResultIndex:=funcResultIndex+1; end; funcPointer:=funcPointer+36; end; setLength(result,funcResultIndex); exit(result); end; function tInventory.getItems(funcID,funcColourID:array of int32):glTextureArray;overload; var funcContinue:boolean; funcPointer:pointer; funcColourIDIndex, funcIDIndex, funcPointerIndex, funcPointerSize, funcResultIndex:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); setLength(result,funcPointerSize); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break; for funcIDIndex:=0 to high(funcID) do begin if funcPointer^=funcID[funcIDIndex] then for funcColourIDIndex:=0 to high(funcColourID) do begin if similarColors((funcPointer+4)^,funcColourID[funcColourIDIndex],oglColourTolerance) and (abs(0+(funcPointer+20)^-(funcPointer+28)^)>1) and (abs(0+(funcPointer+24)^-(funcPointer+32)^)>1) then begin result[funcResultIndex]:=glTexture(funcPointer^); funcResultIndex:=funcResultIndex+1; end; end; end; funcPointer:=funcPointer+36; end; setLength(result,funcResultIndex); exit(result); end; { ======================================== EXAMPLES: ---------------------------------------- __itemCount:=tInventory.getItemCount(); ======================================== } function tInventory.getItemCount():int32; var funcContinue:boolean; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcContinue:=true else if funcContinue then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if ((funcPointer+20)^-0<>(funcPointer+28)^-0) and (abs(0+(funcPointer+20)^-(funcPointer+28)^)>1) and (abs(0+(funcPointer+24)^-(funcPointer+32)^)>1) then result:=result+1; funcPointer:=funcPointer+36; end; exit(result); end; { ======================================== EXAMPLES: ---------------------------------------- (* DESCRIPTION: The ID 119085 belongs to all summoning pouches. *) __item:=tInventory.getSlot(2); if __item.id<>119085 then clickMouse(__item.x,__item.y,1); ======================================== } function tInventory.getSlot(funcSlot:int32):glTexture; var funcPointer:pointer; funcPointerIndex, funcPointerSize, funcSlotIndex:uInt32=0; funcX, funcY:int32; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then begin if funcSlotIndex=funcSlot then begin funcX:=(funcPointer+12)^+2; funcY:=(funcPointer+16)^; end; funcSlotIndex:=funcSlotIndex+1; end else if funcSlotIndex<>0 then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if ((funcPointer+12)^=funcX) and ((funcPointer+16)^=funcY) then begin result:=glTexture(funcPointer^); break; end; funcPointer:=funcPointer+36; end; exit(result); end; { ======================================== EXAMPLES: ---------------------------------------- (* DESCRIPTION: The ID 119085 belongs to all summoning pouches. *) __isFull:=tInventory.isFull(); ======================================== } function tInventory.isFull():boolean; var funcPointer:pointer; funcPointerIndex, funcPointerSize, funcSlotIndex:uInt32=0; begin funcPointer:=glTextures(funcPointerSize); {if funcPointerSize<1 then exit();} for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=88625 then funcSlotIndex:=funcSlotIndex+1 else if funcSlotIndex<>0 then break; funcPointer:=funcPointer+36; end; if funcPointerIndex=funcPointerSize then exit(); for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=73440) and similarColors((funcPointer+4)^,1256246,oglColourTolerance) then break else if (funcPointer+20)^-0<>(funcPointer+28)^-0 then funcSlotIndex:=funcSlotIndex-1; funcPointer:=funcPointer+36; end; result:=funcSlotIndex=0; exit(result); end;