Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RSCE_GetF2Fatigue(var fatiguePercent: Integer): Boolean;
- begin
- fatiguePercent := StrToIntDef(Between('Fatigue: ', '%', GetTextAtEx(6, 160, 0, MSSL_MM.st[RSCE_MMS].font[RSCE_MainFont].obj, False, False, 0, 0, -1, 13, True, tr_AllChars)), -1);
- Result := InRange(fatiguePercent, 0, 100);
- end;
- function RSCE_GetFatigue(var fatiguePercent: Integer): Boolean;
- var
- tm, tm2: Integer;
- questTab: Boolean;
- pt: TPoint;
- begin
- if RSCE_GetF2Fatigue(fatiguePercent) then
- Exit;
- if not RSCE_MouseInsideApplet then
- pt := Point(13, 20)
- else
- GetMousePos(pt.X, pt.Y);
- if RSCE_OpenGameTab(RSCE_GAMETAB_STATS) then
- begin
- tm := GetSystemTime;
- questTab := (CountColor(11894627, 499, 63, 506, 68) >= 17);
- while (CountColor(11894627, 499, 63, 506, 68) >= 17) do
- begin
- if ((GetSystemTime - tm) >= 5000) then
- Exit;
- if ((GetSystemTime - tm2) > 333) then
- begin
- RSCE_Click(319, 42, 84, 11, True);
- tm2 := GetSystemTime;
- end;
- end;
- fatiguePercent := StrToIntDef(GetNumbers(GetTextAtEx(365, 192, 0, MSSL_MM.st[RSCE_MMS].font[RSCE_MainFont].obj, False, False, 0, 0, 65535, 3, True, tr_AllChars)), -1);
- Result := fatiguePercent > -1;
- if questTab then
- RSCE_Click(419, 42, 84, 11, True);
- RSCE_Mouse(pt.X, pt.Y, 0, 0);
- end else
- RSCE_Mouse(pt.X, pt.Y, 0, 0);
- end;
- function RSCE_TooTired: Boolean;
- var
- xArr, yArr: TIntArray;
- tmp, yaTPA: TPointArray;
- begin
- if (FindColorEx(tmp, 65280, 7, 183, 48, 315) or
- FindColorEx(tmp, 16777215, 7, 183, 48, 315)) then
- if (High(tmp) > 150) then
- begin
- xArr := [7, 12, 13, 7, 8, 11, 12, 7, 8, 11, 12, 15, 16, 17, 18, 21, 22, 25, 26, 32, 33, 34, 35, 38, 39, 40, 41, 44, 45, 46, 47, 8, 9, 10, 11, 14, 15, 18, 19, 21, 22, 25, 26, 31, 35, 36, 38, 39, 43, 44, 47, 48, 9, 10, 14, 15, 18, 19, 21, 22, 25, 26, 33, 34, 35, 36, 38, 39, 43, 44, 47, 48, 9, 10, 14, 15, 18, 19, 21, 22, 25, 26, 32, 33, 35, 36, 38, 39, 43, 44, 45, 46, 47, 48, 9, 10, 14, 15, 18, 19, 21, 22, 25, 26, 31, 32, 35, 36, 38, 39, 43, 44, 9, 10, 14, 15, 18, 19, 21, 22, 24, 25, 26, 31, 32, 35, 36, 38, 39, 43, 44, 47, 48, 9, 10, 15, 16, 17, 18, 22, 23, 25, 26, 32, 33, 34, 35, 36, 38, 39, 44, 45, 46, 47];
- yArr := [307, 307, 307, 308, 308, 308, 308, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315];
- if MSSL_TPAFromXYArrays(yaTPA, xArr, yArr) then
- begin
- SetLength(yArr, 0);
- yArr := [0, -12, -24, -36, -48, -60, -72, -84, -96, -108, -120];
- Result := MSSL_TPAInTPAByYOffsets(yaTPA, tmp, yArr);
- end;
- SetLength(yaTPA, 0);
- SetLength(xArr, 0);
- SetLength(yArr, 0);
- end;
- SetLength(tmp, 0);
- end;
- function RSCE_Sleeping: Boolean;
- begin
- Result := (CountColor(65535, 160, 33, 349, 54) = 1215) and
- (CountColor(0, 160, 33, 349, 54) = 2965);
- end;
- function RSCE_GetSleepingWord(var word: string): Boolean;
- var
- tmp: TIntArray;
- str, fs: string;
- bmp: TSCARBitmap;
- h, i, f, tm, whiteCount: Integer;
- begin
- word := '';
- tmp := GetColors(TPAFromBox(Box(129, 230, 383, 269)));
- TIAUnique(tmp);
- h := High(tmp);
- if (h > 0) then
- begin
- for i := 0 to h do
- if ((tmp[i] <> 0) and (tmp[i] <> 15527148)) then
- begin
- SetLength(tmp, 0);
- Exit;
- end;
- SetLength(tmp, 0);
- whiteCount := CountColor(15527148, 129, 230, 383, 269);
- if (whiteCount > 300) then
- begin
- fs := (RSCE_LEOSLEEP_PATH + 'slword.txt');
- if FileExists(fs) then
- if not DeleteFile(fs) then
- Exit;
- if FileExists(RSCE_LEOSLEEP_PATH + 'temp.bmp') then
- if not DeleteFile(RSCE_LEOSLEEP_PATH + 'temp.bmp') then
- Exit;
- bmp := GetClient.CaptureEx(129, 230, 383, 269);
- bmp.SaveToBMP(RSCE_LEOSLEEP_PATH + 'hc.bmp');
- bmp.Free;
- Wait(100);
- tm := GetSystemTime;
- repeat
- if FileExists(fs) then
- try
- f := OpenFile(fs, False);
- if ReadFileString(f, str, FileSize(f)) then
- begin
- word := GetLetters(str);
- Result := (word <> '');
- end;
- CloseFile(f);
- except
- CloseFile(f);
- Exit;
- end;
- Wait(10);
- until (Result or ((GetSystemTime - tm) > 10000));
- end;
- end else
- SetLength(tmp, 0);
- end;
- function RSCE_GetDifferentSleepingWord: Boolean;
- var
- p, p2, tm, tm2, tm3: Integer;
- tmp, tmp2: TIntArray;
- pts, pts2: TPointArray;
- begin
- tm := GetSystemTime;
- repeat
- if not RSCE_Sleeping then
- Exit;
- tmp := GetColors(TPAFromBox(Box(129, 230, 383, 269)));
- p := Length(tmp);
- if p > 0 then
- begin
- TIAUnique(tmp);
- if High(tmp) > 0 then
- if MSSL_TIABuiltWith(tmp, [0, 15527148]) then
- if FindColorEx(pts, 15527148, 129, 230, 383, 269) then
- if GetTextAtEx(168, 269, 0, MSSL_MM.st[RSCE_MMS].font[RSCE_MainFont].obj, False, False, 0, 0, 65535, 10, True, tr_AllChars) = 'click here' then
- begin
- RSCE_Click(171, 298, 51, 6, True);
- tm2 := GetSystemTime;
- repeat
- if ((GetSystemTime - tm2) >= 10000) then
- Break;
- if ((GetSystemTime - tm3) > 250) then
- begin
- tmp2 := GetColors(TPAFromBox(Box(129, 230, 383, 269)));
- p2 := Length(tmp2);
- if (p2 > 0) then
- begin
- TIAUnique(tmp2);
- if (High(tmp2) > 0) then
- if MSSL_TIABuiltWith(tmp, [0, 15527148]) then
- if FindColorEx(pts2, 15527148, 129, 230, 383, 269) then
- Result := ((p <> p2) or not MSSL_TPASame(pts, pts2));
- end;
- SetLength(pts2, 0);
- SetLength(tmp2, 0);
- tm3 := GetSystemTime;
- end;
- until (Result or ((GetSystemTime - tm) >= 180000));
- end;
- end;
- SetLength(pts, 0);
- SetLength(tmp, 0);
- until (Result or ((GetSystemTime - tm) >= 180000));
- SetLength(tmp, 0);
- end;
- function RSCE_Sleep(word: string): Boolean;
- var
- p, p2, tm, tm2: Integer;
- tmp, tmp2: TIntArray;
- pts, pts2: TPointArray;
- incorrect: Boolean;
- begin
- if (not RSCE_Sleeping or (word = '')) then
- Exit;
- tm := GetSystemTime;
- tmp := GetColors(TPAFromBox(Box(129, 230, 383, 269)));
- p := Length(tmp);
- if (p > 0) then
- begin
- TIAUnique(tmp);
- if (High(tmp) > 0) then
- if MSSL_TIABuiltWith(tmp, [0, 15527148]) then
- if FindColorEx(pts, 15527148, 129, 230, 383, 269) then
- begin
- TypeText(word + #13);
- tm2 := GetSystemTime;
- repeat
- if ((GetSystemTime - tm2) > 250) then
- begin
- tmp2 := GetColors(TPAFromBox(Box(129, 230, 383, 269)));
- p2 := Length(tmp2);
- if (p2 > 0) then
- begin
- TIAUnique(tmp2);
- if (High(tmp2) > 0) then
- if MSSL_TIABuiltWith(tmp, [0, 15527148]) then
- if FindColorEx(pts2, 15527148, 129, 230, 383, 269) then
- incorrect := ((p <> p2) or not MSSL_TPASame(pts, pts2));
- end;
- SetLength(pts2, 0);
- SetLength(tmp2, 0);
- tm2 := GetSystemTime;
- end;
- if not incorrect then
- Result := RSCE_LoggedIn and not RSCE_Sleeping;
- until (Result or incorrect or ((GetSystemTime - tm) >= 60000));
- end;
- end;
- SetLength(pts, 0);
- SetLength(tmp, 0);
- end;
- function RSCE_UseSleepingBag: Boolean;
- var
- TPA: TPointArray;
- ATPA: T2DPointArray;
- tm, tm2, l: Integer;
- pt: TPoint;
- begin
- if RSCE_OpenGameTab(RSCE_GAMETAB_INVENTORY) then
- if FindColorEx(TPA, 3036283, RSCE_Inventory.slot.grid[0].bx.X1, RSCE_Inventory.slot.grid[0].bx.Y1, RSCE_Inventory.slot.grid[(RSCE_INVENTORY_SLOT_COUNT - 1)].bx.X2, RSCE_Inventory.slot.grid[(RSCE_INVENTORY_SLOT_COUNT - 1)].bx.Y2) then
- begin
- ATPA := SplitTPA(TPA, 1);
- SetLength(TPA, 0);
- SortATPABySize(ATPA);
- MSSL_ATPAExtractSize(ATPA, 131);
- l := Length(ATPA);
- if (l > 0) then
- begin
- MSSL_ATPAExtractDimension(ATPA, 17, 17);
- l := Length(ATPA);
- if (l = 0) then
- Exit;
- TPA := CopyTPA(ATPA[(l - 1)]);
- SetLength(ATPA, 0);
- pt := TPAMiddle(TPA);
- tm := GetSystemTime;
- repeat
- Result := RSCE_Sleeping;
- if not Result then
- if ((GetSystemTime - tm2) >= 5000) then
- if RSCE_OpenGameTab(RSCE_GAMETAB_INVENTORY) then
- if RSCE_Click(pt.X, pt.Y, RandomRange(-9, 9), RandomRange(-5, 5), True) then
- tm2 := GetSystemTime;
- until (Result or ((GetSystemTime - tm) >= 60000));
- end;
- end;
- end;
- function RSCE_ReadyToSendWord: Boolean;
- var
- w, h: Integer;
- TPA: TPointArray;
- begin
- if FindColorEx(TPA, 65535, 300, 72, 320, 90) then
- begin
- TPADimensions(TPA, w, h);
- Result := ((Length(TPA) = 147) and (w = 21) and (h = 18));
- SetLength(TPA, 0);
- end;
- end;
- function RSCE_Sleep2: Boolean;
- var
- s: string;
- tm, tm2: Integer;
- begin
- if not RSCE_Sleeping then
- Exit;
- tm := GetSystemTime;
- repeat
- if RSCE_GetSleepingWord(s) then
- if ((s <> '') and (s <> 'unknown')) then
- begin
- tm2 := GetSystemTime;
- while not RSCE_ReadyToSendWord do
- begin
- Wait(100);
- if ((GetSystemTime - tm2) >= 60000) then
- Break;
- end;
- if RSCE_ReadyToSendWord then
- Result := RSCE_Sleep(s);
- end else
- RSCE_GetDifferentSleepingWord;
- Wait(10);
- until (Result or ((GetSystemTime - tm) >= 300000));
- end;
- function RSCE_Slept: Boolean;
- var
- fp: Integer;
- begin
- RSCE_GetF2Fatigue(fp);
- if (not (fp = 100) and not RSCE_TooTired and not RSCE_Sleeping) then
- Exit;
- if not RSCE_Sleeping then
- if not RSCE_UseSleepingBag then
- Exit;
- if RSCE_Sleeping then
- Result := RSCE_Sleep2;
- end;
Advertisement
Add Comment
Please, Sign In to add comment