[EasyUO] Runes to Runebooks Reorganiser

Discussion about the technical aspects of scripting. Ask about all issues involving your freelance projects here.
Locked
Ryslock
Novice Scribe
Posts: 9
Joined: Mon Jun 22, 2009 7:15 am

[EasyUO] Runes to Runebooks Reorganiser

Post by Ryslock »

Minor update... < where it should have been <=...Whoopsie.

After using Penny's CraftAid for a while, I ended up with a few hundred mixed runes in bags. Sorting them out manually would have taken ages...

A Runes-to-Runebook Reorganizing script. It'll look at the name of the runebook - if it finds the name of the book in a marked rune in a user-specified bag, that rune will be dropped into the book. Beats doing it by hand. :mrgreen:

Tutorial added just because I felt like it. Feel free to set it to 'no' or remove that section.

Code: Select all

;Ryslock's Runes to Runebook Reorganiser.

set %DisplayTutorial yes

If %DisplayTutorial = yes
{
 display Press the F3 key to start a sort!$$This script will sort runes into books based on the name of the runebook.$If the runebook is named 'Platinum' all runes containing the word 'Platinum' will be moved to that book.$$It could be 'vendor', 'zircote', 'tailor', you name it!$$Intended to be a supplement to resource marking with Penny's CraftAid.$$The script does not support filling multiple runebooks at the moment.
}

keyloop:
	onHotKey F3
		gosub Main
goto keyloop

Sub Main
;Optional settings
set %DropDelay 500 ;Increasing this number will slow down the speed it tries to add runes to the book (in case of lag).
set %RuneBagID Not_Targeted ;If you use the main pack all the time, set this to #BackPackID.

;---------------------
set %RuneType QWL ;Do not change
set %RuneBookID Not_Targeted ;Do not change

set %RunebookName ;Clear
set %LinebreakCharacter ;Clear
If %RuneBookID = Not_Targeted
{
 set #targcurs 1
 display Target the runebook
 while #targcurs = 1
  {
   wait 5
  }
 set %RuneBookID #ltargetID
 event property %RuneBookID
 set %RuneBookName #property

 str del %RuneBookName 1 17
 set %RuneBookName #strres
 str len %RuneBookName
 set %LinebreakCharacter #strres
 str del %RuneBookName %LinebreakCharacter 1
 set %RunebookName #strres
}

If %RuneBagID = Not_Targeted
{
 set #targcurs 1
 display Target the container holding the runes to be sorted (backpack on paperdoll if in mainpack)
 while #targcurs = 1
 {
  wait 5
 }
 set %RuneBagID #ltargetID
}

finditem %RuneType C_ , %RuneBagID
set %jrnl #jindex
while #findIndex <= #findCnt
{
 event property #findid
 if %RuneBookName in #property
 {
  exevent drag #findID
  exevent dropc %RuneBookID
  sleep %DropDelay
  if #jindex > %jrnl
  {
   set %jrnl %jrnl + 1
   scanjournal %jrnl
   if This_runebook_is_full in #journal
   {
    display Runebook is full! Press F3 to restart when ready.
    Goto keyloop
   }
   if You_cannot_place_objects_in_the_book_while_viewing_the_contents in #journal
   {
    display Runebook is bugged! You will have to log back in to add runes to it.
    Goto keyloop
   }
  }
 }
 else
 {
 ignoreitem #findID
 }
 set #findIndex #findIndex + 1
}
}
ignoreitem reset
Display All runes containing the word %RuneBookName have been moved to the runebook.
Return
Locked