PDA

View Full Version : Trade Screen and Duel Screen?



Hey321
12-13-2006, 08:49 PM
Ok, as some of you may know im making a dueler. The only problem is the duel screen. I've tried getting and matching colours, that but with tolerances, i even tried game tabs. None of it is working. Any ideas? Or would you just like to give me it :). Anyways time to do homework...

c0de
12-13-2006, 09:46 PM
I don't get it, what colors? Just make it wait for Other player has accepted and then click accept ? :\

Hey321
12-13-2006, 09:53 PM
No, i have it so it finds the colour with 25 tolerance and then clicks it if it finds it. Only problem is it keeps talking and accepting duels in the time to. I need it to find the screen THEN if it does stop the procedure and go to the next one.

Junior
12-13-2006, 11:06 PM
Put
if (duelscreen) then break; IF its in a loop.
That will exit out of the loop its in and move to the next procedure.. or just use a exit? I cant tell you what to do, I dont know what your script looks like or how your procedure is set up.

c0de
12-13-2006, 11:08 PM
You want to know if DuelScreen window is open?

Hey321
12-13-2006, 11:13 PM
Yea, basicly lol.

Junior
12-13-2006, 11:20 PM
let me see your function and procedure ill help.

Hey321
12-13-2006, 11:24 PM
Well this is the duel function:



function Duel: Boolean;
begin
if (not (TabExists(1))) Then
Result := True
else
Result := False;
end;

I've tried colors, colors with tolerances and that. This is the script:



{If i forgot you in credits PM me on villu-reborn.com and i will add you.
Credits:
Boreas/Yakman for the chat coords
Junior for the DuelScreen help}
Program DuelTrainer;
{.include SRL/SRL.scar}


function Duel: Boolean;
begin
if (not (TabExists(1))) Then
Result := True
else
Result := False;
end;

Procedure GetDuel;
Begin
Repeat
TypeSend('Funning all');
If (findcolorTolerance(x, y, 12926 , MCX1, MCY1, MCX2, MCY2, 25)) Then
Begin
MMouse(x, y, 3, 3);
Mouse(x,y,3,3, True);
End;
Until(Duel)
End;

Procedure Accept1;
Begin
If (findcolorTolerance(x, y, 32768 , MSX1, MSY1, MSX2, MSY2, 25)) Then
Begin
MMouse(x, y, 3, 3);
Mouse(x, y, 3, 3, True);
If (findcolorTolerance(x, y, 32768 , MSX1, MSY1, MSX2, MSY2, 25)) Then
Begin
MMouse(x, y, 3, 3);
Mouse(x, y, 3, 3, True);
Mouse(582, 227, 3, 3, True)
End;
End;
End;



Begin
SetupSRL;
ActivateClient;
Repeat
GetDuel;
Accept1;
Until(False);
End.

It will be a pay script(hopefully) later when i perfect it add a proggy that stuff.

Junior
12-13-2006, 11:41 PM
try this out, I have no clue if it will work or not.

{If i forgot you in credits PM me on villu-reborn.com and i will add you.
Credits:
Boreas/Yakman for the chat coords
Junior for the DuelScreen help}
Program DuelTrainer;
{.include SRL/SRL.scar}


function Duel: Boolean;
begin
if (not (TabExists(1))) Then
Result := True
else
Result := False;
end;

Procedure GetDuel;
Begin
Repeat
TypeSend('Funning all');
If (findcolorTolerance(x, y, 12926 , MCX1, MCY1, MCX2, MCY2, 25)) Then
Begin
MMouse(x, y, 3, 3);
Mouse(x,y,3,3,True);
Flag;
wait(2000+Random(2000))
if Duel Then Break;
End;
Until(False)
End;

Procedure Accept1;
Begin
If (findcolorTolerance(x, y, 32768 , MSX1, MSY1, MSX2, MSY2, 25)) Then
Begin
MMouse(x, y, 3, 3);
Mouse(x, y, 3, 3, True);
If (findcolorTolerance(x, y, 32768 , MSX1, MSY1, MSX2, MSY2, 25)) Then
Begin
MMouse(x, y, 3, 3);
Mouse(x, y, 3, 3, True);
Mouse(582, 227, 3, 3, True)
End Else
If Not(findcolorTolerance(x, y, 32768 , MSX1, MSY1, MSX2, MSY2, 25)) Then
Exit;
End;
End;




Begin
SetupSRL;
ActivateClient;
Repeat
if Not(LoggedIn)then break;
GetDuel;
if Not(LoggedIn)then break;
Accept1;
Until(False);
End.

Hey321
12-13-2006, 11:44 PM
Wow! You even used standards for me :). *runs off to try it* <- read that.


Edit: holy shit this hates me... It still doesnt work :(. Anyways ill keep trying.

Arr0w
12-14-2006, 09:07 AM
Mre specific? where doesn't it work?

Hey321
12-14-2006, 11:47 AM
Well if you read my other posts i'v said twice it wont find the duel screen...

Arr0w
12-14-2006, 11:58 AM
Instead of using.


If (DuelScreen) then



you could make it looks for certain text that is on the duel screen.


-Arr0w

Hey321
12-14-2006, 12:02 PM
I know, its how i do it lol, i dont know text finding procedures.

Arr0w
12-14-2006, 12:13 PM
Text.scar


procedure TypeByte(k: Byte);
By: Mutant Squirrle
Description:
Types one char.

procedure TypeSend(Text: String);
By: Mutant Squirrle
Description:
Types text humanlike using random timeing on keys.

function SendText2(Text: String): Boolean;
By: RSN | Modded By: Spky
Description:
Types text humanlike making mistakes, returns true if mistake has
been made.

procedure SendText(Text: String);
By: RSN
Description:
Types text humanlike.

function GetOption: String;
By: WT-Fakawi
Description:
Returns text in upperleft corner.

function GetUpText: String;
By: WT-Fakawi
Description:
Returns text in upperleft corner.

function Option2(Text: String): Boolean;
By: Freddy1990
Description:
Searches for text in upperleft corner.

function ReadUpText(Text: String): Boolean;
By: Mutant Squirrle
Description:
Returns up text that might be to the right

function IsUpText(UpText: String): Boolean;
By: Masquerader
Description:
Returns up text that might be to the right

function IsUpTextMulti(UT1, UT2, UT3: String): Boolean;
By: WT-Fakawi
Description:
Returns any of three UpText that might be to the right
Usefull when text is partially masked.
Use: IsUpTextMulti('Attack','tta','ack')

function FindText(var cx, cy: Integer; txt: String; font, xs, ys, xe, ye: Integer): Boolean;
By: Stupid3ooo
Description:
Searches for text in specified box with specified font.

function ClickTextArea(x1, y1, x2, y2: Integer; text: String; font: Integer): Boolean;
By: Mutant Squirrle
Description:
Clicks Text on Specified Box

function ClickText(Text: String; x1, y1, x2, y2: Integer): Boolean;
By:
Description:
Searches for text in specified area if text is found then it
clicks it

function ClickText2(txt: String; font, xs, ys, xe, ye: Integer; left: Boolean): Boolean;
By: Stupid3ooo
Description:
Clicks text if found in box.

function FindNpcChatText(txt: String): Boolean;
By: Kernel Klink or Stupid3000, font by Masquerader
Description:
Get last chat message.

function ClickNpcChatText(txt: String): Boolean;
By: Kernel Klink or Stupid3000, font by Masquerader
Description:
Get last chat message.

function FindInventoryText(txt: String): Boolean;
By: Stupid3ooo
Description:
Finds inventory text.

function ClickOption(s: String; i: Integer): Boolean;
By: RSN
Description:
Clicks Option in Specified Area (1 for Main Screen, 2 Inventory,
3 for Chat Window), returns True if text was found

function PopUp(Option: String): Boolean;
By: RsN
Description:
Finds Popup menu, then clicks Option.

function PopUp2(x, y, rx, ry: Integer; Option: String): Boolean;
By: RsN
Description:
Right clicks on coords, then Clicks on Option in Popup menu

function ChooseOption(x, y: Integer; txt: String): Boolean;
By: Stupid3ooo
Description:
Finds Popup menu, then clicks on it.

function Capitalize(S: String): String;
By: RSN/StarBlaster
Description:
Will Capitalize strings as Runescape i are noob = I Are Noob

procedure FindTextSpiral(txt: String; dx, dy: Integer; SpiralSize: Integer; step, SpiralWait: Integer);
By: OhDearUrDead / Khain
Description:
Finds object by moving mouse in spiral pattern.

procedure CloseWindow;
By: Stupid3ooo
Description:
Closes frontmost window.

function hitkeys(send: Boolean): Integer;
By: Pyro
Description:
Hits Random 4 Keys that are random 4 dist away. Good for smelt or cook x

function HumanText(Text: String; Chance: Integer): String;
By: Pyro
Description:
Returns A text humanly. DOES NOT TYPE. But will make ACTUAL human Mistakes
Chance is like well think of it as 1 out of ......

function LastChatter(var name: String): Boolean;
By: masquerader
Description:


function GetLastChatText(var chat: String): Boolean;
By: masquerader
Description:


function SaveToChatLog: Boolean;
By: WT-Fakawi / masquerader
Description:
Saves chat to log file

function GetNewChatMsg: String;
By: Stupid3ooo
Description:
Get last chat message.

function IsChatMessage(s: String): Boolean;
By:
Description:
Checks if last chat message matches specified.

function InChat(Text: String): Boolean;
By: WT-Fakawi
Description:
Grabs Last Chat Line and performs checks on occurence of text

function InChatMulti(Text1, Text2, Text3: String): Boolean;
By: WT-Fakawi
Description:
Grabs Last Chat Line and performs checks on three occurences of text

procedure SendText3(Ttx: String);
By:
Description:
If makes mistakes will type correct format quickly

function FindChatText(txt: String): Boolean;
By: Stupid3ooo
Description:
Searches for text in chat window.

Hey321
12-14-2006, 12:45 PM
Thanks, i looked through but i didnt find any that could seem helpful, sorry :X.

Arr0w
12-14-2006, 12:56 PM
IsUpTextMulti('Due', 'Stac', 'Acce')

Whats wrong with using something like that?

Hey321
12-14-2006, 01:02 PM
I'm looking for the script to know when the screen is open, i have it opening the screen without fail, its finding out that its open. Sorry if i wasnt clear ;).

XcanadamanX
12-14-2006, 11:13 PM
is there any text like on the top of the bank if so you can just use findtext. but im a nonmem so i dont know if there is text on top of the duel window.