ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Superslayer on March 26, 2009, 05:31:59 AM
-
A part of my script currently removes the users headwear and puts a Mask of Orcish Kin on for a little while. After such time has passed, the Mask is removed and the headpiece originally on is placed back on. This very last part is giving me problems. Here's a snippet:
set %headwear YVI_GZH_HZH_NJL_BWI_KWI_IWI_EWI_QJL_JWI_XVI_CZH_HWI_JJN_NZH_BZH_TDI_OZH_VSH_WVI
+_VVI_QSH_KZH_PZH_DZH_MIN_DSH_ASH_TSH_ESH_YPH_GSH_OSH_ZPH_ZRH_IWL_CSH_BSH_FSH_DPH_LKO_NWL_MKH
event macro 8 1
wait 20
set %pdollcontid #contid
finditem %headwear C_ , %pdollcontid
if #findkind = 0
{
set %currheadwearid #findid
exevent drag %currheadwearid
wait 20
exevent dropc #backpackid
wait 20
}
finditem VSH C_ , #backpackid ; Orc mask
if #findkind = 0
{
set %orcmask #findid
set #findmod 17_10 ;(x_y)
click #findx #findy g
wait 20
click 915 120 mc
wait 20
set #findmod 0_0
}
finditem %orcmask C_ , %pdollcontid
if #findkind = 0
{
exevent drag %orcmask
wait 20
exevent dropc #backpackid
wait 20
;set #findmod 100_190
exevent drag %currheadwearid
wait 15
click 915 120 mc d
}
The trick is, I have no idea what the user may be wearing, therefor, know what the findmod could possibly be. Additionally, the script as is won't put first hat back on. everything else works good. I'd like this to be able to pick up the headwear no matter the type without altering the findmod, or ask for user input about it.
-
Start by changing this:
if #findkind = 0
to this:
if #findCnt > 0
As referenced at EUO #Findkind is not the preferred method to check whether an item was found or not because it is harder for humans to debug. Please use #FINDCNT instead, whenever possible.
Is there some reason your not using "exevent droppd" ?
-
Thanks, I'll give that a try. From all I've read, recently even, droppd apparently is broken in some way and has been for a long while with no eta
-
I thought that had been resolved, guess not then.
-
well, changing to findcnt didn't change anything for the better, the piece was still found and lifted, but still didnt' drop it on the paperdoll equipping it. Orngrimm has a small script that I'm trying out, but I'm modding it a little with no luck. Here's his script in full and a link (http://www.easyuo.com/forum/viewtopic.php?p=9320#9320)
;==================================
; Script Name: Findmod-o-matic
; Author: Orngrimm (Parts of the .js are from Spewy)
; Version: 2.0
; Client Tested with: 4.0.1a
; EasyUO version tested with: 1.40 B:005C
; Shard OSI / FS: OSI
; Revision Date: 17.10.2003
; Public Release: 17.10.2003
; Purpose: Gets the findmod with the help of the user (Delta of Find-coords and Clickable-Coords)
;
; Disclaimer: Dont change this script and release it under own name.
; Let this header intact and dont distribute without it!
; DONT distribute without my permission!! (PM Orngrimm @ easyuo.com)
; Copyright: by Orngrimm
;==================================
initevents
; --------------------- MAINSCRIPT ---------------------
start:
set #TargCurs 1
display yes Klick the item (Have to be in a container)
wait:
set #LtargetID null
wait 1 ; Dops CPU-Load
if #LtargetID = null
goto wait
set %orig_x #CursorX
set %orig_y #CursorY
set #FindMod 0_0 ; To get the exact position
Finditem #LtargetID C
set %xmod %orig_x - #FindX
set %ymod %orig_y - #FindY
set #FindMod %Xmod , _ , %ymod ; Now i should have the correc Findmod to target the stack...
; display yes FindMod for type #FindType is #FindMod
; Uncomment if you want to check (Inactive "dont move cursor" is a good idea...)
; click #FindX #FindY n ; Now you should be ofer the item and able to click it
; pause
; Uncomment if you want to use a filewriter (Creation of a Database)
event property #FindID
gosub write
goto start
I've excluded the .js for obvious reasons and am trying to set it so no user interaction occurs. I'm attempting to have the cursor move to and target the headpiece. From there the script should equip it, but as I stated, having a little trouble.
-
event macro 8 1
wait 5
set %xpos #contposx + 100
set %ypos #contposy + 50
wait 1s
exevent drag %currheadwearid
wait 10
click %xpos %ypos mc
wait 10
Waits are a little long to ensure it works the first time. That *should* work.
-
Unfortunately, that didn't too anything any different from what I have setup atm. It was lifted and moved, but not dropped.
-
It's actually moving the item, but not releasing it? Can you manually click the mouse after it's been moved and drop the item onto the char?
Maybe just add in another left click after?
-
ya, it is lifting the item. Because I'm using exevent drag and not click xxx yyy d mc, the item 'disappears'. I have tried the multiple clicks after lifting and stopping the script, but it didn't do anything. It's strange that when equipping the orc mask, there are no problems, given I have the #findmod for it, but when the item is unknown, I have no way to get the findmod. Otherwise, the script can be just as simple for equipping the orc mask as it should be to re-equip the previous headgear. Yet, such is not the case, silly EUO not having the droppd fixed for this long already :P
-
If you use
exevent dropc %pdollcontid
Does it go back into your backpack? This sucks not being able to try stuff out... they need to make a UO simulator for running scripts LOL.
-
yup, right into my backpack
-
This has been broken on OSI for a LONG LONG LONG time now. However, it works perfectly on RunUO.....
@Cerveza.... You should really think about installing a RunUO shard on your workstation.. ;)
-
Can I install one on a Thumb Drive? ;D
-
Can I install one on a Thumb Drive? ;D
I'll bet you can!!
The install directory is only 40.0MB
-
Ok, I have something that may actually work. Aside from the script not setting my paperdoll in a specific place, this seems to pick up, and place on the paperdoll.
Please try this with as much headwear as you can all find. I've only done this with a bandana so far, but I'll continue. here's the code, sloppy as it is.
set %headwear YVI_GZH_HZH_NJL_BWI_KWI_IWI_EWI_QJL_JWI_XVI_CZH_HWI_JJN_NZH_BZH_TDI_OZH_VSH_WVI
+_VVI_QSH_KZH_PZH_DZH_MIN_DSH_ASH_TSH_ESH_YPH_GSH_OSH_ZPH_ZRH_IWL_CSH_BSH_FSH_DPH_LKO_NWL_MKH
exevent dropc
event macro 8 1
set %pdollcontid #contid
set #findmod 0_0
finditem %headwear C_ , %pdollcontid
if #findkind = 0
{
set %currheadwearid #findid
exevent drag %currheadwearid
wait 20
exevent dropc #backpackid
wait 20
set #targcurs 1
finditem %currheadwearid c_ , #backpackid
click #findx #findy mc n
set %orig_x #cursorX
set %orig_y #cursorY
set #FindMod 0_0
set #lobjectid %currheadwearid
event macro 22
Finditem #LtargetID C
set %xmod %orig_x - #FindX
set %ymod %orig_y - #FindY
set #FindMod %xmod , _ , %ymod
Click #findx #findy g mc
wait 15
Click 915 120 mc
}
stop
-
Well, as much as I didn't want to, I decided to go the dreaded event drag %item way. There's just too much involved with simply putting only a headpiece on.