ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: VicVega on April 12, 2009, 06:19:44 AM
-
The shard where I play uses the mondains legacy game.
I have made an script in order to sell my fishes more quickly. The script works fine and serves it's purpose. But I would like to improve this part:
set %amount 30
click 240 80 x %amount ; It clicks 30 times on the first element of the menu list
click 315 420 ; accept button
gosub waitForGumpDisappear
finditem %fishType C_ , #backpackID
}
There is a way to know wich fish it's gonna be first in the buy_list menu?
So I could make something like this:
set %amount #findStack
click 240 80 x %amount ; It clicks 30 times on the first element of the menu list
click 315 420 ; accept button
gosub waitForGumpDisappear
finditem %fishType C_ , #backpackID
}
Use #findstack to determine the number of clicks that have to be made.
Another thing I would like to improve it's the method to open the buy_list gump, I've tried the exevent popup without success with something like this:
finditem %vendor G_10
if #FINDCNT > 0
exevent Popup #findid 1
halt
The complete working script that I'm currently using:
;==================================
; Script Name: SellSub
; Author: VicVega
; Version: 0.1
; Client Tested with: 5. Something
; EUO version tested with: 1.5 (Version 148)
; Shard: Epsilon UO
; Revision Date: 12-04-09
; Public Release:
; PSL Release:
; Purpose: Sells all fish in your Backpack to an NPC
;==================================
set %fishType GQD_TLW_VLW_DMW_LGW_NGW_GMW_FQD_OGW_WLW_
+YLW_DQD_SLW_ULW_FMW_EMW_XLW_RLW_EQD
set %vendor Conway
sell:
;open vendor's popup menu and click sell option
finditem %fishType C_ , #backpackID
while #findkind <> -1
{
msg %vendor sell $
gosub waitForgump
set %amount 30
click 240 80 x %amount
click 315 420 ; accept button
gosub waitForGumpDisappear
finditem %fishType C_ , #backpackID
}
exit
sub waitForGump
set %timeout #scnt + 5
loop:
If #contname <> bill_gump
{
if #scnt > %timeout
return
else
goto loop
}
return
sub waitForGumpDisappear
set %timeout #scnt + 5
loop2:
If #contname = bill_gump
{
if #scnt > %timeout
return
else
goto loop2
}
return
Also later on I'm planning on add another sub in order to know how muck money it's gained in the complete transaction.
-
I don't belive there is a way to search the first fish in the SELL gump, there are however ways to search in the BUY gump
-
The only way to do it is buy pixel scanning the sell gump .. can be done but not so easy
-
I will leave a static number of clicks then.
Any idea why exevent popup doesn't work?
The #findID of the vendor I use in order to try to use the exevent popup it's fine but nothing happens.
-
Event popup has been bugged for quite some time. Actually I thought it worked on RunUO-based shards, but has never worked for me on OSI. Normally when I use event popup, I wait for the particular gump to popup and then manually click into the gump region. This works for OSI/RunUO/Anything:
exevent popup !bagofsending
gosub GumpWait normal_gump normal_gump
set !clickx #CONTPOSX + 30
set !clicky #CONTPOSY + 28
click !clickx !clicky dmc
-
Event popup has been bugged for quite some time. Actually I thought it worked on RunUO-based shards, but has never worked for me on OSI. Normally when I use event popup, I wait for the particular gump to popup and then manually click into the gump region. This works for OSI/RunUO/Anything:
exevent popup !bagofsending
gosub GumpWait normal_gump normal_gump
set !clickx #CONTPOSX + 30
set !clicky #CONTPOSY + 28
click !clickx !clicky dmc
What's this? -> !bagofsending
you don't use the vendor's ID on the exevent popup?
-
What's this? -> !bagofsending
you don't use the vendor's ID on the exevent popup?
Oh, that's just the #FINDID of my bag of sending. This was just a snippet of code that also uses event popup, but on a BOS.
-
Here's an extended example of how I use the context menu for items/venders:
http://www.scriptuo.com/index.php?topic=79.0
-
I think I understand then, but the problem it's that I also use #findID in order to use exevent popup:
set %vendor IS
finditem %vendor G_10
if #FINDCNT > 0
exevent Popup #findid
halt
But it doesn't work, nothings happens and I don't know why.
-
Are you on a RunUO-based shard?
-
It's a Sphere Server. It uses Mondains Legacy 5.8.0.1
Sphere server 0.59b I think
-
It's a Sphere Server. It uses Mondains Legacy 5.8.0.1
Sphere server 0.59b I think
Hummm, that might be the problem. Where it works perfectly on RunUO, and kinda works on OSI, it just may not work at all on Sphere. I'm afraid you might be out of luck. The only other way I can think of is to manually click the vender, wait for gump and continue. Problem with that is you'll have to convert world to screen coordinates. That can be problematic. ;)