[EasyUO] Focus' Runebook Copier
Posted: Wed Dec 14, 2011 8:52 am
Copies runebooks from one book to an other. The runebook can be from a library or in your backpack! To copy a library book recall to your library rune and follow the instructions.
Not a very fancy script. Some updates should follow. Feedback is always welcome.
Not a very fancy script. Some updates should follow. Feedback is always welcome.
Code: Select all
;; ------ Focus' Runebook Copier ------ ;;
;; ------------------------------------ ;;
set %start 1
menu hideEUO
if *FMSave = 1
{
gosub setLastSettingsMenu
menu show
set #menubutton Jibberish
lastSet:
if #menubutton = Yes
{
gosub loadMovement
goto elastSet
}
if #menubutton = No
{
gosub recordMovement
gosub saveMovement
goto elastSet
}
if #menubutton = closed
halt
goto lastSet
elastSet:
}
else
{
gosub recordMovement
gosub saveMovement
}
gosub setSettingsMenu
menu set instructions1 Select the book to
menu set instructions2 be copied in to.
menu show
set #targCurs 1
while #targCurs = 1
{
wait 2
if #menubutton = closed
halt
}
set %copy #lTargetId
set %library #true
finditem %original C
if #findKind <> -1
set %library #false
if %library
gosub getLibraryStuff
gosub setSettingsMenu #false #false
menu set instructions1 Copying...
menu show
set #menuButton Jabber
for %rune %start 16
{
menu set instructions2 %rune out of 16
if #menuButton = closed
halt
gosub mark
if %library
{
if #menuButton = closed
halt
gosub recall %libBook %libRune
gosub moveToBook
}
}
halt
sub mark
gosub recall %original %rune
finditem QWL c
if #findKind = -1
{
display ok You do not have any runes
halt
}
event macro 15 44
target 4s
if #targCurs = 0
{
display ok No target coming up. Maybe out of regs?
halt
}
set #lTargetId #findId
set #lTargetX #findX
set #lTargetY #findY
set #lTargetZ #findZ
set #lTargetKind 1
event macro 22
wait 20
exevent drag #findId
wait 20
exevent dropc %copy
wait 80
return
sub recall
set %rX #charPosX
set %rY #charPosY
recallLoop:
set #lObjectId %1
event macro 17
wait 30
set %clickX #contPosX + 410
set %clickY #contPosY + 25
set %page ( ( %2 - 1 ) / 2 ) + 1
for %i 1 %page
{
click %clickX %clickY
wait 4
}
;; To click on Chiv recall
set %clickY #contPosY + 180
;; Which side of the page?
if ( %2 + 1 ) % 2 + 1 = 1
set %clickX #contPosX + 140
else
set %clickX #contPosX + 300
click %clickX %clickY
wait 50
if %rX = #charPosX && %rY = #charPosY
{
wait 100
goto recallLoop
}
return
sub moveToBook
for %i 1 %steps
{
move %X . %i %Y . %i 2 2s
wait 2
}
return
sub recordMovement
gosub setSettingsMenu #false #false
menu set instructions1 Stand at your recall point,
menu set instructions2 move to the book and target it.
menu show
set #targCurs 1
set %it 1
set %X . 1 #charPosX
set %Y . 1 #charPosY
while #targCurs = 1
{
if %X . %it <> #charPosX || %Y . %it <> #charPosY
{
set %it %it + 1
set %X . %it #charPosX
set %Y . %it #charPosY
}
}
set %steps %it
set %original #lTargetId
return
sub saveMovement
set *FRSave 1
set *FRSteps %steps
set *FROriginal %original
for %j 1 %steps
{
set *FRx . %j %X . %j
set *FRy . %j %Y . %j
}
return
sub loadMovement
set %steps *FRSteps
set %original *FROriginal
for %j 1 %steps
{
set %X . %j *FRx . %j
set %Y . %j *FRy . %j
}
return
sub getLibraryStuff
gosub setSettingsMenu #false #false
menu set instructions1 Target the runebook containing
menu set instructions2 a rune to the library.
menu show
set #targCurs 1
while #targCurs = 1
wait 4
set %libBook #lTargetId
gosub setSettingsMenu #true #true
menu set instructions1 Which number is the library
menu set instructions2 rune at?
set #menuButton Blah
while #menuButton = Blah
wait 4
menu get settingsEdit
set %libRune #menuRes
if ! ( %libRune > 0 ) || %numbooks > 16
{
display ok %numBooks is not a valid rune location number.
menu hide
halt
}
return
sub setSettingsMenu
menu clear
menu window size 300 100
menu window title Focus' Runebook
menu font color black
menu window color white
menu font bgColor white
menu font size 14
menu text instructions1 0 0
menu text instructions2 0 20
menu font size 9
if %1
menu edit settingsEdit 70 78 60
if %2
menu button but 150 78 50 20 Next
return
sub setLastSettingsMenu
menu clear
menu window size 200 100
menu window title Focus' Runebook
menu font color black
menu window color white
menu font bgColor white
menu font size 14
menu text instructions1 10 20 Would you like to use
menu text instructions2 24 40 your last settings?
menu font size 9
menu button yes 40 78 50 20 Yes
menu button no 110 78 50 20 No
return