function tDialogue.clickContinue():boolean; var funcPointer:^glTexture; funcPointerSize:uInt32; funcPoint: TPoint; begin funcPointer:=glTextures(funcPointerSize)+(oglTextureSize*(funcPointerSize-2)); for 1 to funcPointerSize-1 do begin if funcPointer^.id=142800 then begin funcPoint:=funcPointer^.bounds.normalizePoint(); clickMouse(funcPoint.x, funcPoint.y, 1); result:=true; break; end; funcPointer-=oglTextureSize; end; exit(result); end; function tDialogue.getConversation():string; var funcBounds:tBox; funcID, funcPointerIndex, funcPointerSize:uInt32=0; funcPointer:pointer; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-10 do begin if (funcPointer^=1374215) and ((funcPointer-396)^=12664320) then begin funcBounds:=[(funcPointer-376)^,(funcPointer-372)^,(funcPointer-368)^,(funcPointer-364)^]; break; end; funcPointer:=funcPointer-36; end; if funcPointerIndex<>funcPointerSize-9 then begin funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex:=0 to funcPointerSize-1 do begin if (funcPointer^=191) and pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then begin if (result<>'') and (single((funcPointer+68)^)-(single((funcPointer+20)^)+(0+(funcPointer+40)^))<>0) then result:=' '+result; result:=char((funcPointer+16)^)+result; end else if result<>'' then break; funcPointer:=funcPointer-48; end; end; end; end; exit(result); end; function tDialogue.getInput():string; var funcBounds:tBox; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=17204850 then begin funcBounds:=[(funcPointer+20)^,(funcPointer+24)^,(funcPointer+28)^,(funcPointer+32)^]; break; end; funcPointer:=funcPointer-36; end; if funcPointerIndex<>funcPointerSize then begin funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if ((funcPointer^=182) or (funcPointer^=274) or (funcPointer^=68)) and similarColors((funcPointer+4)^,8388608,oglCOlourTolerance) and pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then begin if (result<>'') and (single((funcPointer+68)^)-(single((funcPointer+20)^)+integer((funcPointer+40)^))<>0) then result:=' '+result; result:=char((funcPointer+16)^)+result; end else if result<>'' then break; funcPointer:=funcPointer-48; end; end; end; end; exit(result); end; function tDialogue.getOptions():tStringArray; var funcBounds:tBox; funcPointer:pointer; funcPointerIndex, funcPointerSize, funcResultIndex:uInt32=0; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=12664320) and ((funcPointer+360)^=65800) then begin funcBounds:=[(funcPointer+20)^,(funcPointer+24)^,(funcPointer+28)^,(funcPointer+32)^]; break; end else funcPointer:=funcPointer-36; end; if funcPointerIndex<>funcPointerSize then begin funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1)); if funcPointer<>nil then begin setLength(result,funcPointerSize); for funcPointerIndex:=0 to funcPointerSize do begin if pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then begin if result[funcResultIndex]<>'' then begin if 0+(funcPointer+12)^-(funcPointer+60)^<-10 then begin result[funcResultIndex]:=replaceRegExpr('(\d \d \. \.)$',result[funcResultIndex],'',false); funcResultIndex:=funcResultIndex+1; end else if single((funcPointer+68)^)-(single((funcPointer+20)^)+integer((funcPointer+40)^))<>0 then result[funcResultIndex]:=' '+result[funcResultIndex]; end; if (funcPointer+16)^<>160 then result[funcResultIndex]:=char((funcPointer+16)^)+result[funcResultIndex] else result[funcResultIndex]:=' '+ result[funcResultIndex]; end else if result[funcResultIndex]<>'' then begin result[funcResultIndex]:=replaceRegExpr('( \d \d \. \.)$',result[funcResultIndex],'',false); break; end; funcPointer:=funcPointer-48; end; setLength(result,funcResultIndex+1); result:=result.reverse(); end; end; end; exit(result); end; function tDialogue.getPrompt():ansiString; var funcBounds:tBox; funcID, funcPointerIndex, funcPointerSize:uInt32=0; funcPointer:pointer; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=17204850) or (funcPointer^=12664320) then begin funcBounds:=[(funcPointer+20)^,(funcPointer+24)^,(funcPointer+28)^,(funcPointer+32)^]; break; end; funcPointer:=funcPointer-36; end; if funcPointerIndex<>funcPointerSize then begin funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin case (funcID:=funcPointer^) of 182,191,274,68: begin if pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then begin if (result<>'') and (single((funcPointer+68)^)-(single((funcPointer+20)^)+integer((funcPointer+40)^))<>0) then result:=' '+result; result:=char((funcPointer+16)^)+result; end else if result<>'' then break; end; else if result<>'' then break; end; funcPointer:=funcPointer-48; end; end; end; end; exit(result); end; function tDialogue.getTitle():ansiString; var funcBounds:tBox; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=714000) and ((funcPointer-36)^=12664320) then begin funcBounds:=[(funcPointer+20)^,(funcPointer+24)^,(funcPointer+28)^,(funcPointer+32)^]; break; end; funcPointer:=funcPointer-36; end; if funcPointerIndex<>funcPointerSize then begin funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then begin if (result<>'') and (single((funcPointer+68)^)-(single((funcPointer+20)^)+integer((funcPointer+40)^))<>0) then result:=' '+result; result:=char((funcPointer+16)^)+result; end else if result<>'' then break; funcPointer:=funcPointer-48; end; end; end; end; exit(result); end; function tDialogue.hasContinue():boolean; var funcPointer:^glTexture; funcPointerSize:uInt32; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-2)); for 1 to funcPointerSize-1 do begin if funcPointer^.id=142800 then begin result:=true; break; end; funcPointer-=oglTextureSize; end; exit(result); end; function tDialogue.hasDialogue():boolean; var funcID:int32; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin case (funcID:=funcPointer^) of 12664320,17204850,714000: begin result:=true; break; end; end; funcPointer:=funcPointer-36; end; end; exit(result); end; function tDialogue.hasInput():boolean; var funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=17204850 then begin result:=true; break; end; funcPointer:=funcPointer-36; end; end; exit(result); end; function tDialogue.setInput(funcInput:ansiString):boolean; var funcBounds:tBox; funcCurrentInput:ansiString; funcPointer:pointer; funcPointerIndex, funcPointerSize:uInt32=0; begin funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if funcPointer^=17204850 then begin funcBounds:=[(funcPointer+20)^,(funcPointer+24)^,(funcPointer+28)^,(funcPointer+32)^]; break; end; funcPointer:=funcPointer-36; end; if funcPointerIndex<>funcPointerSize then begin funcPointer:=glFonts(funcPointerSize)+(48*(funcPointerSize-1)); if funcPointer<>nil then begin for funcPointerIndex to funcPointerSize-1 do begin if (funcPointer^=68) and similarColors((funcPointer+4)^,8388608,oglCOlourTolerance) and pointInBox([(funcPointer+8)^,(funcPointer+12)^],funcBounds) then begin if (funcCurrentInput<>'') and (single((funcPointer+68)^)-(single((funcPointer+20)^)+integer((funcPointer+40)^))<>0) then funcCurrentInput:=' '+funcCurrentInput; funcCurrentInput:=char((funcPointer+16)^)+funcCurrentInput; end else if funcCurrentInput<>'' then break; funcPointer:=funcPointer-48; end; end; if length(funcCurrentInput) and (funcCurrentInput<>funcInput) then begin sendKeys(#8,normalRandom(0,60),normalRandom(0,60)); tDialogue.setInput(funcInput); end else if (funcCurrentInput<>funcInput) then begin sendKeys(funcInput+#10,30+normalRandom(0,20)*5,30+normalRandom(0,20)*5); result:=true; end else begin sendKeys(#10,normalRandom(0,60),normalRandom(0,60)); result:=true; end end; end; exit(result); end; function tDialogue.setOption(funcOption:int32):boolean; var funcOptions:array of string; begin funcOptions:=tDialogue.getOptions(); if length(funcOptions)>=funcOption then begin sendKeys(toStr(funcOption),30+normalRandom(0,20)*5,30+normalRandom(0,20)*5); result:=true; end; exit(result); end; function tDialogue.setOption(funcOption:array of string):boolean;overload; var funcOptions:array of string; funcOptionIndex, funcOptionsIndex:int32=0; begin funcOptions:=self.getOptions(); if length(funcOptions) then for funcOptionsIndex to high(funcOptions) do begin for funcOptionIndex:=0 to high(funcOption) do if pos(lowerCase(funcOption[funcOptionIndex]),lowerCase(funcOptions[funcOptionsIndex])) then begin sendKeys(toStr(funcOptionsIndex+1),30+normalRandom(0,20)*5,30+normalRandom(0,20)*5); result:=true; break; end; if result then break; end; exit(result); end; function tDialogue.setOption(funcOption:string):boolean;overload; begin exit(result:=tDialogue.setOption([funcOption]));end;