ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on June 10, 2014, 02:48:03 PM

Title: Another question if you don't mind......
Post by: Grandewd on June 10, 2014, 02:48:03 PM
(http://i1142.photobucket.com/albums/n616/grindy45/GumpMoving_zpsfa800199.png)
Title: Re: Another question if you don't mind......
Post by: TrailMyx on June 10, 2014, 02:55:07 PM
Perhaps this set of subs will help.  I used these to organize the spell icons from your spellbook.  The ability icons should be similar.

http://www.scriptuo.com/index.php?topic=65.0

Also, in my bushido script, there's a sub you might be interested in.  I think it's called setupabilityicon:

http://www.scriptuo.com/index.php?topic=62.15
Title: Re: Another question if you don't mind......
Post by: Grandewd on June 10, 2014, 04:08:33 PM
Awesome, TM - thx a bunch guy...
I know, I should already know how to do that after all these years, but you know how containers are sometimes - like when you think you're moving one and you end up moving another because text came up before lcontpos, etc...
I want to see how you identify and move them... I know Cheffe has been changing/adding some things to containers lately, and there's some interesting info on that over on the EUO main forum in the EasyUO 1.5.1 beta builds thread....
Title: Re: Another question if you don't mind......
Post by: TrailMyx on June 10, 2014, 04:55:11 PM
Yeh, if you look at that code, you'll see that there's no automatic method to make those icons move.  In practice it was pretty reliable, but I always feel more comfortable knowing there's a mechanical method for things instead of relying on "hope" for a script working.  So hopefully Cheffe can come up with something that'll help with this function in a more official way.
Title: Re: Another question if you don't mind......
Post by: manwinc on June 22, 2014, 12:07:44 PM
Gosub Move_PrimaryAbility X Y
Gosub Move_SecondaryAbility X Y
Gosub Move_LightningStrike X Y
Gosub Move_Momentum X Y

It does pixel scan The Top left corner of each box to check if its already in position. I usually arrange them left to right. let me know if it gives you any trouble.

Code: [Select]
;=====================================

Sub Move_PrimaryAbility
Namespace Push
Namespace Local Mwinc_Move_PrimaryAbility
set !LPC #LPC
set #LPC 9999
set !X %1
set !Y %2
set !X_Start !X - 1
set !X_End !X
set !Y_Start !Y - 1
set !Y_End !Y + 1
set !Cipher1
for !X_Scan !X_Start !X_End
{
For !Y_Scan !Y_Start !Y_End
{
Gosub Save_Pix2 !X_Scan !Y_Scan
Str Left #Pixcol 1
set !Cipher1 !Cipher1 , #Strres
}
}
if !Cipher1 = 000011
{
set #Lpc !Lpc
Namespace Pop
Return
}
Event macro 8 14
Gosub Cont_Timer 30 Contsize 406_249
Gosub Click_Offset 243 127 G
Gosub Cont_Timer 30 COntName AbilityIcon_Gump
if #ContName = AbilityIcon_Gump
{
Gosub Click_Offset 15 15 f
Contpos !X !Y
}
Event Macro 9 14
set #LPC !LPC
Namespace Pop
Return

;======================================

Sub Move_SecondaryAbility
Namespace Push
Namespace Local Mwinc_Move_PrimaryAbility
set !LPC #LPC
set #LPC 9999
set !X %1
set !Y %2
set !X_Start !X - 1
set !X_End !X
set !Y_Start !Y - 1
set !Y_End !Y + 1
set !Cipher1
for !X_Scan !X_Start !X_End
{
For !Y_Scan !Y_Start !Y_End
{
Gosub Save_Pix2 !X_Scan !Y_Scan
Str Left #Pixcol 1
set !Cipher1 !Cipher1 , #Strres
}
}
if !Cipher1 = 000011
{
set #Lpc !Lpc
Namespace Pop
Return
}
Event macro 8 14
Gosub Cont_Timer 30 Contsize 406_249
Gosub Click_Offset 243 171 G
Gosub Cont_Timer 30 COntName AbilityIcon_Gump
if #ContName = AbilityIcon_Gump
{
Gosub Click_Offset 15 15 f
Contpos !X !Y
}
Event Macro 9 14
set #Lpc !LPC
Namespace Pop
Return
;====================================

Sub Move_LightningStrike
Namespace Push
Namespace Local Mwinc_Move_LightningStrike
set !Lpc #Lpc
set #Lpc 9999
set !X %1
set !Y %2
set !X_Start !X - 1
set !X_End !X
set !Y_Start !Y - 1
set !Y_End !Y + 1
set !Cipher1
for !X_Scan !X_Start !X_End
{
For !Y_Scan !Y_Start !Y_End
{
Gosub Save_Pix2 !X_Scan !Y_Scan
Str Left #Pixcol 1
set !Cipher1 !Cipher1 , #Strres
}
}
if !Cipher1 = 000011 || !Cipher1 = 000055
{
set #Lpc !Lpc
Namespace Pop
Return
}
Finditem QON C_ , #Backpackid
if #findcnt < 1
{
set #Lpc !Lpc
Namespace Pop
Return
}
Event macro 8 15
Gosub Cont_Timer 30 Contsize 406_249
if #Result = #True
{
set #Lpc !Lpc
Namespace Pop
Return
}
Gosub Click_Offset 335 18 x 3
Wait 10
Gosub Click_Offset 90 76 G
Gosub Cont_Timer 30 COntName SpellIcon_Gump
if #ContName = SpellIcon_Gump
{
Gosub Click_Offset 15 15 f
Contpos !X !Y
}
Event Macro 9 15
set #Lpc !Lpc
Namespace Pop
Return
;========================================
Sub Move_MomentumStrike
Namespace Push
Namespace Local Mwinc_Move_MomentumStrike
set !LPC #LPC
set #Lpc 9999
set !X %1
set !Y %2
set !X_Start !X - 1
set !X_End !X
set !Y_Start !Y - 1
set !Y_End !Y + 1
set !Cipher1
for !X_Scan !X_Start !X_End
{
For !Y_Scan !Y_Start !Y_End
{
Gosub Save_Pix2 !X_Scan !Y_Scan
Str Left #Pixcol 1
set !Cipher1 !Cipher1 , #Strres
}
}
if !Cipher1 = 000011 || !Cipher1 = 000055
{
set #Lpc !Lpc
Namespace Pop
Return
}
Finditem QON C_ , #Backpackid
if #findcnt < 1
{
set #Lpc !Lpc
Namespace Pop
Return
}
Event macro 8 15
Gosub Cont_Timer 30 Contsize 406_249
if #Result = #True
{
set #Lpc !Lpc
Namespace Pop
Return
}
Gosub Click_Offset 335 18 x 3
Wait 10
Gosub Click_Offset 252 76 G
Gosub Cont_Timer 30 COntName SpellIcon_Gump
if #ContName = SpellIcon_Gump
{
Gosub Click_Offset 15 15 f
Contpos !X !Y
}
Event Macro 9 15
set #Lpc !Lpc
Namespace Pop
Return
;===================================
;===================================
Sub Cont_Timer
; Gosub Cont_Timer (Timer) ( Var ) ( Value )
Namespace Push
Namespace Local Mwinc_Cont_Timer
set !Lpc #Lpc
set #lpc 9999
set !Time_Limit #scnt2 + %1
set !Cont_Check # . %2
While !Cont_Check <> %3 && !Time_Limit > #scnt2
{
set !Cont_Check # . %2
wait 1
}
set #Lpc !LPC
if !Time_Limit <= #scnt2
{
Namespace Pop
Return #true
}
Namespace Pop
Return #False
;=============================
;========================================================
Sub Click_Offset
Namespace Push
Namespace Local Mwinc_ClickOffset
set !Clickx #contposx + %1
set !CLicky #contposy + %2
Click !Clickx !CLicky %3 %4
set %3 0
set %4 0
Namespace pop
Return
;===============================================

;====================================
Sub Save_Pix2
Namespace Push
Namespace Local Save_Pix2
Set !SaveX %1
set !SaveY %2
Savepix !SaveX !SaveY 1
Namespace Pop
Return
;=====================================