ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Cerveza on January 03, 2012, 05:46:05 AM
-
My other post is titled Working on a pixel scan sub (http://www.scriptuo.com/index.php?topic=9047.0) which might be a little deceiving. The truth is that I'm looking for a script that will do an Armor Ignore special, then do Lightning Strikes until the 3 second timer is up, then go back to Armor Ignore.
The only "rule" for the script is that Armor Ignore special is done at intervals > 3 seconds to avoid the double mana penalty.
So the script would go something like:
1 Toggle Armor Ignore Special on
2 swings
3 HIT so Armor Ignore Special icon goes off
4 Set 3 second timer
5 check timer, if < 3 seconds continue, if > 3 seconds goto 1
6 Toggle Lightning Strike on
7 swings
8 goto 5
-
Okay, Lets see what We Can Do :)
-
Untested
set %Special_Timer #Systime
set %Special_Mana 15
set %LS_Mana 6
set %Special_Off 1052688_1581353_1581345
set %Special_On 524345_1050698
set %Scan_Timer #Systime
Gosub Move_PrimaryAbility 27 681
Gosub Move_LightningStrike 121 681
While #true
{
Repeat
if %Scan_Timer <= #Systime
{
Gosub Save_Pix2 27 681
if #Pixcol in %Special_Off
Event macro 35 0
set %Scan_Timer #Systime + 250
}
Until #Pixcol Notin %Special_Off
While #Pixcol Notin %Special_Off && A Notin #Charstatus
{
Gosub Save_Pix2 27 681
wait 5
}
if A Notin #Charstatus
{
While #Systime < #Systime + 3000
{
if %Scan_Timer < #Systime
{
Gosub Save_Pix2 121 681
if #Pixcol in %Special_Off && #Mana > %LS_Mana
Event Macro 15 149
set %Scan_Timer #Systime + 250
}
}
}
}
;====================================
Sub Save_Pix2
Namespace Push
Namespace Local Save_Pix2
Set !SaveX %1
set !SaveY %2
Savepix !SaveX !SaveY 1
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_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 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
;===============================================
-
LOL nice mwing! I'll run that in the grinder this evening and see what comes out ;)
I had tried messing with it, but as simple as the project seemed it kept getting more and more complicated.
-
Did it Ever Work out for you Cerveza? Or did you ever get something Running For it?
-
I never got a chance to test it out... but I hope to have a full Ultima day tomorrow.
-
I smell Shame applications!
-
Yeppers
-
Btw, I'm in the process of collecting all of the mob IDs for shame.
I have most of them, however there is an issue with one of the mage id's being IS_ which is also the ID of male human players.
So the script will attack guildmates with that ID, or in fel, people with that ID.
-
Not working, does one armor ignore then toggles LS on and off.
-
Not elegant....
gosub setpixel-LightningStrike
gosub setpixel-ArmorIgnore
display ok Ready to Begin
repeat
if #mana > 30
gosub exec-ArmorIgnore
if #mana < 30
gosub exec-LightningStrike
wait 1
until #false
sub exec-LightningStrike
wait 5
cmppix 1 t ; Lightning Strike
return
event macro 15 149
wait 5
return
sub exec-ArmorIgnore
wait 5
cmppix 2 t ; Lightning Strike
return
event macro 35 0
wait 5
return
sub setpixel-LightningStrike
event macro 15 149
display ok Move the mouse to your Lightning Strike Icon.$You have 2 seconds
wait 2s
savePix #CURSORX #CURSORY 1
wait 5
return
sub setpixel-ArmorIgnore
event macro 35 0
display ok Move the mouse to your Armor Ignore Icon.$You have 2 seconds
wait 2s
savePix #CURSORX #CURSORY 2
wait 5
return
Based on mana.
-
If its toggling the LS on and off, then probably just a typo, or i don't have the correct pixel color coded in for recognizing the LS. I'll play with it some.
-
its not quite as pretty as you guys are used to, but this is what ive been tinkering with
keeps up enemy of one, divine furry, concecrate wep(given you dont fail to cast, i put enough chiv so my toon doesnt), ais every 1st, lightning strikes every 3rd
honors + attacks when you get flagged by a monster
you will have to set the x and ys of the lightning strike and ai icons and how long your chiv spells will last
set %pix1-x xxx
set %pix1-y yyy
set %pix2-x xxx
set %pix2-y yyy
set %conctime 10
set %divinetime 20
set %enemytime 200
set %conc #scnt
set %divine #scnt
set %enemy #scnt
main:
if #enemyid <> N/A
{
set #scnt 0
set %divine 0
set %conc 0
set %enemy 0
set #ltargetid #enemyid
set #ltargetkind 1
event macro 49 1
target
event macro 22
event macro 27
goto second
}
wait 10
goto main
second:
if #enemyid = N/A
{
goto main
}
savepix %pix1-x %pix1-y 1
set %color1 #pixcol
savepix %pix2-x %pix2-y 1
set %color2 #pixcol
if #color1 <> 1575011 && #color2 <> 1575011
{
if #mana > 20 && %special => 2
{
event macro 35
wait 10
set %special 0
goto specialout
}
if #mana > 7
{
event macro 15 149
wait 10
set %special %special + 1
}
}
if %conc < #scnt
{
event macro 15 203
set %conc #scnt + %conctime
wait 50
}
if %divine < #scnt
{
event macro 15 205
set %divine #scnt + %divinetime
wait 80
}
if %enemy < #scnt
{
event macro 15 206
set %enemy #scnt + %enemytime
wait 80
}
goto second
but it seems like you want a basic thing like this?
set %x1 xxx
set %y1 xxx
set %x2 xxx
set %y2 xxx
set %red xxxxxxxxx
;------------------------
main:
if %1 > %2
{
set %time #scnt2
gosub toggle
}
goto main
;-------------------------
sub toggle
subtoggle:
if #enemyid = N/A
{
return
}
savepix %x1 %y1 1
set %pix1 #pixcol
savepix %x2 %y2 1
set %pix2 #pixcol
if %pix1 <> %red && %pix2 <> %red && #enemyid <> N/A
{
if #scnt2 => %time && #mana > 20
{
event macro 35
wait 5
set %time #scnt2 + 30
}
else
{
if #mana > 8
{
event macro 15 149
wait 5
}
}
}
goto subtoggle