ScriptUO

Official ScriptUO EasyUO Scripts => Script Library => Crafting => Topic started by: slyone on January 01, 2012, 06:39:01 PM

Title: Runebook Copier
Post by: slyone on January 01, 2012, 06:39:01 PM
I wrote and tested this over my holiday week.  I have been using it the past few days and it has worked great for me.

The setup is pretty easy.  The script doesn't automatically know the names you want for your runes so you'll have to hard code the names in the "SetRuneNames" sub-routine.  I commented out an example I used for my Tram Cities rune names.  Additionally, set the "%numRunes" variable to the number of runes in the book you want copied.

If you don't care what the runes are named then just set the rune names to #FALSE.  After you have hard coded the rune names, start up the script.  Use the menu to set your "runebook to copy" and your "empty runebooks" then press the start button!

The script will pause if you run out of runes.  If this happens, go buy more runes and return to the location where the script paused.  Then start it up again and it should continue where it left off.

I can't thank TM enough for the travel and casting subs.  They are awesome!  Thank you TM!  Thanks also to C2 for the menu tutorial!

Enjoy and reply with any comments.

Code: [Select]
;=================================================================
; Script Name: Runebook Copier
; Author: slyone
; Version: 1.0
; Public Release: 01/01/2012
; Purpose:  Make multiple copies of a runebook...
; Instructions: -Fill your pack full of runes and empty runebooks
;               -Get a runebook you want to copy.
;               -Hardcode the names of the runes in the
;                SetRuneNames sub-routine
;
; Acknowledgements: - Thanks TM for the Travel and Casting Subs!
;                   - Thanks C2 for the menu tutorial!
;=================================================================
Title: Re: Runebook Copier
Post by: Masscre on January 02, 2012, 06:47:33 PM
I need a few rune books copied but i am working this week but maybe over the weekend I an give it a test run.
Title: Re: Runebook Copier
Post by: slyone on January 04, 2012, 08:14:24 AM
Great, let me know what you think.
Title: Re: Runebook Copier
Post by: Cush on December 30, 2012, 03:59:14 PM
I just found this wonderful script and after a little tinkering around got it to work very smoothly.

Is there a way to automatically name the book you are copying to the name of the book you are copying.

Example the book I am copying is titled "Fel Dungeons"

Can I set up the script somehow to name each book copied the same?

Thanks!!
Title: Re: Runebook Copier
Post by: slyone on December 30, 2012, 06:31:53 PM
I just found this wonderful script and after a little tinkering around got it to work very smoothly.

Is there a way to automatically name the book you are copying to the name of the book you are copying.

Example the book I am copying is titled "Fel Dungeons"

Can I set up the script somehow to name each book copied the same?

Thanks!!

Good to here the script is helpful.  I just tested a little code to rename a runebook.  I would insert the following code snippet into the script before line 114 (just before the "display All Done!")

Code: [Select]
;START CODE INSERT (just before line 114)

for %curEmptyBook 1 %numEmptyBooks
{
  msg $ ; clear any text
  OpenRunebook:
  set #LOBJECTID %runebookId . %curEmptyBook ; set runebook as last object
  event macro 17 0 ; last object
  ; wait for runebook to open
  gosub GumpWait generic_gump generic_gump
  if #RESULT = #FALSE
  {
    goto OpenRunebook
  }
  ; xy coordinates for rename button
  set %cx #CONTPOSX + 135
  set %cy #CONTPOSY + 25
  click %cx %cy f ; click the rename button
  wait 10
  msg Fel , #SPC , Dungeons , $ ; Change this line to whatever you'd like
}

;END CODE INSERT

display All Done! ; old line 114
halt              ; old line 115

I think I have the contpos offsets correct.  I didn't have a chance to give this a whirl with the whole script but it should probably work.  I should have some time over the next couple of days to test is out and add a text box for the runebook name.  In the mean time the code snippet above should help you out.
Title: Re: Runebook Copier
Post by: Cush on January 01, 2013, 09:29:26 AM
Thanks!

I have been trying to figure out what everyone means by add at line blah blah blah.

Now I have downloaded the editing tool and away I go!

I loaded the lines and are trying it now.

Yesterday I copied 300 books and it worked flawlessly.

Here is a little with list and I have no idea how complicated this is but I am going to throw this out there.

1. Would be nice if you could set up a secure that had lets say 100 empty runebooks in it where you could take out the empties go fill them and then put the full ones into a different box.
2. The ability to pop over to a vendor and auto buy more runes.

I currently load my backpack with 30 books and as many runes as I can carry about 90 run the script then when its out of runes run to the bank buy more and recall back to the last location. The way you have it set up it works great. lol Just looking to automate a bit further. No clue if it can be done and its for sure over my head.

Thanks for taking a look!

Love it.



Title: Re: Runebook Copier
Post by: Cush on January 01, 2013, 11:46:02 AM
The additional lines seem to label the books just fine. All I have to do is hit enter for the last book when it is done.
Title: Re: Runebook Copier
Post by: Kane12 on January 05, 2013, 11:54:21 AM
The script is working great. Found no hickups or delays.

The problem I seem to have is getting the runes to name.

Here is what I put for 2 runes to test out.....and all I get is "-1" for the rune name when it goes in the runebook.


sub SetRuneNames
  set %numRunes 9
  set %runeName1 #TRUE The , #SPC , Right , #SPC , Spot
  set %runeName2 #TRUE Home



















Any assistance would be appreciated. I must be doing something wrong when hard coding.
Title: Re: Runebook Copier
Post by: slyone on January 05, 2013, 12:02:36 PM
The script is working great. Found no hickups or delays.

The problem I seem to have is getting the runes to name.

Here is what I put for 2 runes to test out.....and all I get is "-1" for the rune name when it goes in the runebook.

Code: [Select]
sub SetRuneNames
  set %numRunes 9
  set %runeName1 #TRUE The , #SPC , Right , #SPC , Spot
  set %runeName2 #TRUE Home

Any assistance would be appreciated. I must be doing something wrong when hard coding.


Your rune names are showing up as -1 (I believe) because that is the value of #TRUE.

Instead of:
Code: [Select]
set %runeName1 #TRUE The , #SPC , Right , #SPC , Spot
set %runeName2 #TRUE Home

Remove the #TRUE and you should be fine:
Code: [Select]
set %runeName1 The , #SPC , Right , #SPC , Spot
set %runeName2 Home

Let me know how it goes.
Title: Re: Runebook Copier
Post by: Endless Night on January 05, 2013, 01:06:37 PM
you might be interested in this little sub i wrote long ago. Feel free to use it as you want. (Link to sub list http://www.scriptuo.com/index.php?topic=2454.msg64241#msg64241)

Code: [Select]
gosub ENs_SetVarTooStringWithSpaces  runeName1  The Right Spot
display %runename1
halt

sub ENs_SetVarToStringWithSpaces
  Set  % . %1
  If %0 > 1 && %0 <> N/A
    {
    For !Count 2 %0
      set % . %1  % . %1 , #spc , % . !Count
    }
return
Title: Re: Runebook Copier
Post by: slyone on January 05, 2013, 01:34:18 PM
Cool sub, thanks for the link.  I'll take a look at.
Title: Re: Runebook Copier
Post by: Kane12 on January 05, 2013, 07:01:48 PM
I expected to put true in place of false if I was using the feature.

Worked perfect.


Thanks
Title: Re: Runebook Copier
Post by: Endless Night on January 05, 2013, 09:04:29 PM
Script move to approved library
Thank you for your submission.


If you feel the script is in the wrong section please send me a pm.
Title: Re: Runebook Copier
Post by: devin123 on June 13, 2013, 09:27:12 PM
I am having problems with this.  Can anyone help me out?
Script recalls to a spot, marks it, renames the rune, then just loops at renaming the rune.
Here is all I edited

Code: [Select]
sub SetRuneNames
  set %numRunes 16
  set %runeName1 Brit , #SPC , Bank , #SPC , West
  set %runeName2 Brit , #SPC , Bank , #SPC , East
  set %runeName3 Cove
  set %runeName4 Jhelom
  set %runeName5 Magincia
  set %runeName6 Minoc
  set %runeName7 Moonglow
  set %runeName8 Nujelm
  set %runeName9 Occlo
  set %runeName10 Vesper
  set %runeName11 Trinsic
  set %runeName12 Yew
  set %runeName13 Serpents , #SPC , Hold
  set %runeName14 Skara , #SPC , Brae
  set %runeName15 Bucs , #SPC , Den
  set %runeName16 Wind

Please msg me on Skype - Whitebayuo
Title: Re: Runebook Copier
Post by: slyone on June 15, 2013, 11:07:30 AM
I am having problems with this.  Can anyone help me out?
Script recalls to a spot, marks it, renames the rune, then just loops at renaming the rune.

...

From your intro, http://www.scriptuo.com/index.php?topic=11307.0 (http://www.scriptuo.com/index.php?topic=11307.0), you say you play on UO Forever.  I believe on some shards, the #PROPERTY variable in EUO is unreliable.  I'm not sure if this is the case on UO Forever.  You may be having an issue with the event property command on line 99.  To debug your problem, you might try to add a line to display what #PROPERTY contains.  A snippet of the test code would look something like this:

(starting at line 92)
Code: [Select]
      RenameRune:
      set #LOBJECTID #FINDID
      event macro 17 0 ; last object
      wait 10 ; wait for prompt to mark rune
      msg  %runeName . %curRune , $
      wait 10 ; wait for rune to change names
      ; check that the rune actually was renamed
      event property #FINDID                              <--------- line 99
      display #PROPERTY                                    <--------- Added line
      if %runeName . %curRune notin #PROPERTY
      {
        goto RenameRune
      }

If you add that line and run the script, you should get a message box that displays the contents of the #PROPERTY variable.  The text in the message box should be the rune name.  The script looks for the expected rune name in #PROPERTY.  So if this test works, then we'll have to try something else.  Give this a try and reply with the results.

Thanks,
S
Title: Re: Runebook Copier
Post by: ZapMcFlash on June 25, 2013, 11:59:07 AM
With that code added, when you add that, and it runes a box pops up after it marks and tries to label the rune, it says "Recall Rune"
Title: Re: Runebook Copier
Post by: devin123 on July 09, 2013, 09:27:02 PM
exactly what he said... when i hit ok, another box pops up. when you hit ok, it renames the rune again, and another box pops up.  this keeps repeating
Title: Re: Runebook Copier
Post by: slyone on July 13, 2013, 03:06:30 PM
If the text in the box that pops up does not contain the new name of the rune then the #PROPERTY variable is probably unreliable on the shard you are on.  I attached a picture of my message box when I renamed a rune "Brit Bank West".  Does your message box look similar?
Title: Re: Runebook Copier
Post by: devin123 on July 16, 2013, 09:04:34 PM
It does rename it. Problem is the script renames it again and again again and again again and again

Post Merge: July 17, 2013, 01:20:18 PM
this script works exept it doesn't read the current runebook so i need to manually type in what to name the runes, other than that it works great.  This get so tireing of typing out each rune every time i want to start copying books.  Maybe this code will help you fix it for me.

Title: Re: Runebook Copier
Post by: slyone on July 17, 2013, 05:28:41 PM
It does rename it. Problem is the script renames it again and again again and again again and again

Post Merge: July 17, 2013, 03:20:18 PM
this script works exept it doesn't read the current runebook so i need to manually type in what to name the runes, other than that it works great.  This get so tireing of typing out each rune every time i want to start copying books.  Maybe this code will help you fix it for me.

~snip~


Glad that it is working for you then.  A few posts ago I posted some test code to try and see if the #PROPERTY variable in EASYUO was working properly.  I only meant the test code to be used for debugging.

If #PROPERTY doesn't contain the name you are trying to rename the rune to then the script will go into a loop.  On some free shards, the event property doesn't populate #PROPERTY with reliable info.  This sounds like it may be the problem you were experiencing.  

The script may try to rename the rune a couple of times in a laggy situation but normally it renames the rune within a try or two.  As for reading the names of the rune book, I initially stayed away from the optical character recognition (OCR) code.  Gonzo's script uses Kal's OCR subs.  I tried to use them a while ago with no success.  I'll take another look but can't make any guarantees.

-S
Title: Re: Runebook Copier
Post by: devin123 on July 17, 2013, 06:41:57 PM
mind helping me with this on skype?
Title: Re: Runebook Copier
Post by: Crome969 on July 17, 2013, 10:23:56 PM
It does rename it. Problem is the script renames it again and again again and again again and again

Post Merge: July 17, 2013, 03:20:18 PM
this script works exept it doesn't read the current runebook so i need to manually type in what to name the runes, other than that it works great.  This get so tireing of typing out each rune every time i want to start copying books.  Maybe this code will help you fix it for me.

~snip~


Glad that it is working for you then.  A few posts ago I posted some test code to try and see if the #PROPERTY variable in EASYUO was working properly.  I only meant the test code to be used for debugging.

If #PROPERTY doesn't contain the name you are trying to rename the rune to then the script will go into a loop.  On some free shards, the event property doesn't populate #PROPERTY with reliable info.  This sounds like it may be the problem you were experiencing.  

The script may try to rename the rune a couple of times in a laggy situation but normally it renames the rune within a try or two.  As for reading the names of the rune book, I initially stayed away from the optical character recognition (OCR) code.  Gonzo's script uses Kal's OCR subs.  I tried to use them a while ago with no success.  I'll take another look but can't make any guarantees.

-S

Runuo based Freesshards always work correct with easyuo content. There are only less few shards not sending property packets or working in AOS Mode. If this is the Case only OCR can help or click on Name and parse Journal.
Title: Re: Runebook Copier
Post by: devin123 on July 29, 2013, 08:36:25 PM
Im so confused. Why would another script be able to rename the runes and then drop the rune in the right blank runebooks.   how can i delete the line to check if its properly renamed.
Title: Re: Runebook Copier
Post by: devin123 on July 30, 2013, 07:57:28 AM
i took a look at both scripts, the one that works with a menu where i need to type in each runes name on the menu.  and this script. they are both written very different.
Title: Re: Runebook Copier
Post by: cashlete on May 04, 2015, 02:05:43 AM
This script is amazing. Thank you very much!
Title: Re: Runebook Copier
Post by: Gandolf on December 26, 2015, 02:39:48 PM
can you made this to work on the new Atlas ?
Title: Re: Runebook Copier
Post by: slyone on December 26, 2015, 07:51:46 PM
can you made this to work on the new Atlas ?

Good question, this script uses TM's Travel sub's (http://www.scriptuo.com/index.php?topic=18.msg18#msg18).  I don't have travel subs that support the new Runic Atlas (http://www.uoguide.com/Runic_Atlas).  So until that time this script won't be able to support it.
Title: Re: Runebook Copier
Post by: TrailMyx on December 28, 2015, 12:40:42 PM
What are the requirements to craft a runic atlas?  As soon as I get one, I'll modify my travel subs to accommodate.
Title: Re: Runebook Copier
Post by: Insideout on December 28, 2015, 12:51:00 PM
The recipe of Course

24 Blank Scrolls
3 Recall Scrolls
3 Gate Travel
3 Blank Rune

Item Type MFHC


Title: Re: Runebook Copier
Post by: TrailMyx on December 28, 2015, 01:02:18 PM
The recipe of Course

24 Blank Scrolls
3 Recall Scrolls
3 Gate Travel
3 Blank Rune

Item Type MFHC

Awesome, I'll see what I can do then.  I figured they required some exotic reagent, so I didn't even bother looking...
Title: Re: Runebook Copier
Post by: Gandolf on January 10, 2016, 05:23:31 AM
say anyway to put a wait time in for mana to build back up ? thx.
Title: Re: Runebook Copier
Post by: slyone on February 01, 2016, 06:52:00 PM
say anyway to put a wait time in for mana to build back up ? thx.

Good question.  It is possible to add a mana check prior to every spell call.  I found an example in The Reaper's post for a Resisting Spells Trainer (http://www.scriptuo.com/index.php?topic=7128.0) (I pasted the specific sub below).  I hesitate to add this specifically since the mana required to cast varies based on lower mana cost.  I'll consider adding this feature in the future.

Code: [Select]
sub checkmana
    if #mana < %manatocast
    {
    event macro 13 46
     loop2:
       if #mana < #maxmana
       {
        goto loop2
       }
    }

return
Title: Re: Runebook Copier
Post by: zhillis on August 09, 2016, 11:52:16 AM
thanks
Title: Re: Runebook Copier
Post by: bdunlap14 on August 22, 2017, 02:21:20 PM
Thanks for the share
Title: Re: Runebook Copier
Post by: Crisis on August 22, 2017, 04:34:54 PM
Thanks for the share

You're very welcome! I am glad you enjoyed it!  ::)
Title: Re: Runebook Copier
Post by: Fabolous1 on January 17, 2020, 08:01:47 PM
How can you add spaces to these variables? Also, is there any chance that anybody has made this support Runic Atlas's?

I tried the whole #spc thing, following easyuo documentation and it didn't work
Title: Re: Runebook Copier
Post by: Gaderian on January 17, 2020, 09:48:46 PM
Did you used the comma operator around the #spc variable and it did not work?
Code: easyuo
  1. set %myvar This , #spc , is , #spc , my , #spc test
Title: Re: Runebook Copier
Post by: The Ghost on January 18, 2020, 08:23:58 AM
I dont think this one add the name of the rune.   I use this a while back I like it.    It just recall mark a rune that it.  U need to rename the rune once done.  But I can be wrong..   
Title: Re: Runebook Copier
Post by: Tbird on May 28, 2020, 03:02:51 PM
I'm new to all this but after joining a new guild and being tasked with making runebooks i wanted to figure out the easiest way