Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OT - Help with Tasking Window
03-16-2017, 08:19 AM
Post: #1
OT - Help with Tasking Window
I'm playing an OT server. The conversation for selecting a task bring up a window to select which creature I want. I need a macro for the bot to select the creature "Cockroaches" and the "Do Task" button. I am not able to just NPCSay it.
Give Reputation to this user
Find all posts by this user
Quote this message in a reply
03-16-2017, 08:25 AM (This post was last modified: 03-16-2017 08:31 AM by Catar.)
Post: #2
RE: OT - Help with Tasking Window
I think it's possible, but it won't be easy, it would require either using manual macro with
Misc.ClickEx(X, Y) which is basically left click mouse (here is example of use)

Or Sending arrow Keys and Enter with Tibia.SendKey(VirtualKeyCode)

You would have lent me some account on this OTS logged out already near NPC, so I could do macro for you quick way,
or slower way, by using the remote desktop app on your computer.
Give Reputation to this user

Before you PM me, READ THIS [Image: KHCf9l2.png]

[Image: naLmyGH.png]

My Scripts, Macros and Tutorials
Find all posts by this user
Quote this message in a reply
03-16-2017, 08:38 AM
Post: #3
Thumbs Up RE: OT - Help with Tasking Window
(03-16-2017 08:25 AM)Catar Wrote:  You would have lent me some account on this OTS logged out already near NPC, so I could do macro for you quick way

Just sent you a PM my bro. Thanks very much
Give Reputation to this user
Find all posts by this user
Quote this message in a reply
03-16-2017, 08:49 AM (This post was last modified: 03-16-2017 10:29 AM by Catar.)
Post: #4
RE: OT - Help with Tasking Window
OK FINISHED

REMEMBER TIBIA CAN NOT BE MINMIZED WITH THIS KIND OF MACRO
Tibia.WindowHeight/Width() canot take sizes of window that is minimized to windows bar, so it would maximize it first, which my interupt with your other activities
also Misc.ClickEx(X, Y) need window to NOT be minmized (however it CAN be covered by other windows)


Paste this in macros

TASKS (manual)
0 {TASKS} Number_on_LIST:=1 {DO NOT TOUCH} loop:=1 tW:=Tibia.WindowWidth() tH:=Tibia.WindowHeight() VarDiv(tW, 2) VarAdd(tW, 213) VarDiv(tH, 2) VarAdd(tH, 122) {TALK} NPC.Say(hi) Macro.Wait(150) NPC.Say(task) {down} !Number_on_LIST!>!loop! [loop] Macro.Wait(150) Tibia.SendKey(40) VarAdd(loop, 1) Macro.Wait(150) Label(down) {loop} Macro.Wait(150) Misc.ClickEx(!tW!, !tH!) exit()


And instead of NPC.Say add macro waypoint
like this: Remeber about Fixed point and Delay
[Image: fDdbZWj.png]





Also u can EDIT this variable in macro ( where 0 works also as 1)
Number_on_LIST:=1

To chose WHICH MOSNTER on a list to pick
For example, 8 for Dragons
Give Reputation to this user

Before you PM me, READ THIS [Image: KHCf9l2.png]

[Image: naLmyGH.png]

My Scripts, Macros and Tutorials
Find all posts by this user
Quote this message in a reply
03-16-2017, 09:59 AM
Post: #5
RE: OT - Help with Tasking Window
(03-16-2017 08:49 AM)Catar Wrote:  OK FINISHED

Thanks so much dude, this works perfectly!!!
Thank god for people like you on this thread Tongue
+ REP
Give Reputation to this user
Find all posts by this user
Quote this message in a reply
03-16-2017, 10:00 AM (This post was last modified: 03-16-2017 10:34 AM by Catar.)
Post: #6
RE: OT - Help with Tasking Window
I gotta say, I LOVE this kind of challenges.

EXPLANATION HOW ITS DONE

Since SendKey enter wouldn't start task, i had to use Mouse Click,
But to do so, I had do know position of Do Task button.

So I had to find fixed position of that button, on ANY TIBIA WINDOW SIZE,
Had to collect some data of button position in different size of windows
distance from center of screen to button
Code:
W ~41   AVG = 213
851-638 = 213
748-540 = 208
1465-1248 = 217
515-301 = 214

H  ~19   AVG =122
829-719 = 110
829-704 = 125
645-518 = 127
444-320 = 124

Knowing that I could make commands sequence to calculate position of button on any window size

Code:
tW:=Tibia.WindowWidth()
tH:=Tibia.WindowHeight()
VarDiv(tW, 2)
VarAdd(tW, 213)
VarDiv(tH, 2)
VarAdd(tH, 122)

rest was easy Wink
Give Reputation to this user

Before you PM me, READ THIS [Image: KHCf9l2.png]

[Image: naLmyGH.png]

My Scripts, Macros and Tutorials
Find all posts by this user
Quote this message in a reply
03-18-2017, 12:31 AM
Post: #7
RE: OT - Help with Tasking Window
(03-16-2017 10:00 AM)Catar Wrote:  = 110
829-704 = 125
645-518 = 127
444-320 = 124[/code]

Knowing that I could make commands sequence to calculate position of button on any window size

Hi mate, the macro is no longer working.

i've followed it to the tee with waypoints and delays. But whenever it begins to run the macro on cavebot it walks down 4 blocks to NPCsay then walks back up.
Give Reputation to this user
Find all posts by this user
Quote this message in a reply
03-18-2017, 01:06 AM (This post was last modified: 03-18-2017 01:17 AM by Catar.)
Post: #8
RE: OT - Help with Tasking Window
send me that script you made on PW.


btw tried that again, and it still works for me, without issue (even with over 240ms latency to the server)

What tibia window size u have? make SS


(its 1 am atm where i live, going to sleep now)
Give Reputation to this user

Before you PM me, READ THIS [Image: KHCf9l2.png]

[Image: naLmyGH.png]

My Scripts, Macros and Tutorials
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)