Author Topic: Runebook Copier  (Read 31773 times)

0 Members and 1 Guest are viewing this topic.

Offline slyoneTopic starter

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Runebook Copier
« on: January 01, 2012, 06:39:01 PM »
+1
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!
;=================================================================

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
RunebookCopierv1p0.txt
Started playing back at the Second Age

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #1 on: January 02, 2012, 06:47:33 PM »
+1
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.

Offline slyoneTopic starter

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #2 on: January 04, 2012, 08:14:24 AM »
+1
Great, let me know what you think.
Started playing back at the Second Age

Offline Cush

  • Sr. Member
  • *
  • Posts: 281
  • Activity:
    0%
  • Reputation Power: 4
  • Cush has no influence.
  • Respect: +42
  • Referrals: 0
    • View Profile
Re: Runebook Copier
« Reply #3 on: December 30, 2012, 03:59:14 PM »
+1
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!!

Offline slyoneTopic starter

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #4 on: December 30, 2012, 06:31:53 PM »
+1
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.
Started playing back at the Second Age

Offline Cush

  • Sr. Member
  • *
  • Posts: 281
  • Activity:
    0%
  • Reputation Power: 4
  • Cush has no influence.
  • Respect: +42
  • Referrals: 0
    • View Profile
Re: Runebook Copier
« Reply #5 on: January 01, 2013, 09:29:26 AM »
+1
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.




Offline Cush

  • Sr. Member
  • *
  • Posts: 281
  • Activity:
    0%
  • Reputation Power: 4
  • Cush has no influence.
  • Respect: +42
  • Referrals: 0
    • View Profile
Re: Runebook Copier
« Reply #6 on: January 01, 2013, 11:46:02 AM »
+1
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.

Offline Kane12

  • Jr. Member
  • **
  • Posts: 99
  • Activity:
    0%
  • Reputation Power: 1
  • Kane12 has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: Runebook Copier
« Reply #7 on: January 05, 2013, 11:54:21 AM »
+1
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.

Offline slyoneTopic starter

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #8 on: January 05, 2013, 12:02:36 PM »
+1
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.
Started playing back at the Second Age

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #9 on: January 05, 2013, 01:06:37 PM »
+1
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
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline slyoneTopic starter

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #10 on: January 05, 2013, 01:34:18 PM »
+1
Cool sub, thanks for the link.  I'll take a look at.
Started playing back at the Second Age

Offline Kane12

  • Jr. Member
  • **
  • Posts: 99
  • Activity:
    0%
  • Reputation Power: 1
  • Kane12 has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: Runebook Copier
« Reply #11 on: January 05, 2013, 07:01:48 PM »
+1
I expected to put true in place of false if I was using the feature.

Worked perfect.


Thanks

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #12 on: January 05, 2013, 09:04:29 PM »
+1
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.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline devin123

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • devin123 has no influence.
  • Respect: +6
  • Referrals: 0
    • View Profile
Re: Runebook Copier
« Reply #13 on: June 13, 2013, 09:27:12 PM »
+1
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
« Last Edit: June 13, 2013, 10:05:54 PM by devin123 »

Offline slyoneTopic starter

  • Full Member
  • ***
  • Posts: 135
  • Activity:
    0%
  • Reputation Power: 2
  • slyone has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: Runebook Copier
« Reply #14 on: June 15, 2013, 11:07:30 AM »
+1
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, 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
Started playing back at the Second Age