Author Topic: Crisis Quick and Painless Spellbook Filler 2.3 *UPDATED 04-08-2015*  (Read 11877 times)

0 Members and 1 Guest are viewing this topic.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Code: [Select]
;===================================================================
;===================================================================
; Script Name: Crisis Quick and Painless Spellbook Filler 2.3
; Author: Crisis
; Version: 2.3
; Client Tested with: 7.0.45.0
; EUO version tested with: 1.5 (version 285)
; Shard OSI / FS: OSI
; Release Date: 06/24/2014
; Revision Date: 04/07/2015
; Purpose:
;     .Fill spellbooks with stored spell scrolls Magery, Necromancy, and Mysticism.
;
; Revisions:
;     1.1 fixed typo in mysticism scrolls
;     2.0 Added support for magery scrolls kept in secures by circle
;     2.1 Added ability to hardcode the 8 spell circle containers
;         Adjusted Dragtospellbooksub to take one scroll instead of the whole stack
;         Adjusted a wait 1 to sub Idle to save on system resources
;         Added a return statement at the end of "sub StartMultiSpellbookFiller" and "sub StartSpellbookFiller"
;     2.2 Cleaned up code for better efficiency
;     2.3 Added Script Status
;         Removed code for picking scrolls up from floor
;
; Requirements:
;     . You need to have blank spellbooks and a secure with loose spell scrolls within reach.
;
; Future Updates:
;     . Add a ability to pick up empty books from a secure and drop off full books.
;
; Special Thanks:
;     . Manwinc for helping me learn about parsing and arrays and answering my MANY questions while working on this.
;     . Endless Night for helping me fix mistakes and clean up the code for better efficiency
;
; Copyright: 2014-2015 Crisis
;===================================================================
;===================================================================

Revisions:
1.1 fixed typo in mysticism scrolls
2.0 Added support for magery scrolls kept in secures by circle
2.1 Added ability to hardcode the 8 spell circle containers
      Adjusted Dragtospellbooksub to take one scroll instead of the whole stack
      Adjusted a wait 1 to sub Idle to save on system resources
      Added a return statement at the end of "sub StartMultiSpellbookFiller" and "sub StartSpellbookFiller"
2.2 Cleaned up code for better efficiency
2.3 Added Script Status
      Removed code for picking scrolls up from floor

This will take spell scrolls stored in a secure and fill a spellbook with it. It will work with magery, necromancy, and msyticism scrolls/books.
There is a start/pause button for quick and painless filling of numerous empty or partially filled spellbooks.

It will fill a magery spellbook from 8 different secures if you store them by circle. You can hardcode the secures in or just choose them through the setup.

I used this as a learning tool and to save time and clicks filling spellbooks with all of the loose scrolls that I collect fishing and treasure hunting.

Enjoy and let me know how it works for you!

A special thanks to Manwinc for all his help and patience while I was learning about parsing and arrays and Endless Night for helping me fix mistakes and clean up the code for better efficiency!

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
Crisis Quick and Painless Spellbook Filler 2.3.txt
« Last Edit: April 10, 2015, 08:30:05 PM by Crisis »

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 1.0
« Reply #1 on: June 23, 2014, 10:05:54 PM »
+1
Current Version 2.3

Please post how it worked for ya!
« Last Edit: April 08, 2015, 06:49:49 PM by Crisis »

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6190
  • Activity:
    3%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +273
  • Referrals: 3
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 1.0
« Reply #2 on: June 24, 2014, 04:46:49 AM »
+1
Thanks - it was me! I thought I'd test it this weekend!
Just a suggestion:
I like it when people post an update to change the version number ie 1.1 or 1.01 - if large change 2.0 etc
« Last Edit: June 24, 2014, 04:49:22 AM by gimlet »

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 1.0
« Reply #3 on: April 06, 2015, 05:36:07 PM »
+1
Updated to fix typo in mysticism

Offline Kandie

  • Full Member
  • ***
  • Posts: 192
  • Activity:
    0.8%
  • Reputation Power: 3
  • Kandie has no influence.
  • Gender: Female
  • a.k.a "Granny"
  • Respect: +20
  • Referrals: 7
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 1.0
« Reply #4 on: April 06, 2015, 06:51:17 PM »
+1
yup works good,( just I have my spells in 8 different bags each bag for a circle so I have to remove them and pile them all in one container), If you could make it so I could keep them separated  that would be better, but still it beats filling by hand :) thx ;)

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 1.0
« Reply #5 on: April 06, 2015, 06:54:50 PM »
+1
yup works good,( just I have my spells in 8 different bags each bag for a circle so I have to remove them and pile them all in one container), If you could make it so I could keep them separated  that would be better, but still it beats filling by hand :) thx ;)

I am in the middle of that now, I have them separated by circle as well. I will hopefully have it ready tomorrow. :)

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 2.0 *UPDATED 04-07-2015*
« Reply #6 on: April 06, 2015, 08:16:32 PM »
+1
I added version 2.0

Revisions:
1.1 fixed typo in mysticism scrolls
2.0 Added support for magery scrolls kept in secures by spell circle

Let me know how it works!

Offline Kandie

  • Full Member
  • ***
  • Posts: 192
  • Activity:
    0.8%
  • Reputation Power: 3
  • Kandie has no influence.
  • Gender: Female
  • a.k.a "Granny"
  • Respect: +20
  • Referrals: 7
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 2.0 *UPDATED 04-07-2015*
« Reply #7 on: April 06, 2015, 08:57:46 PM »
+1
ok I'll try it out tomorrow, right now am making spell scrolls, cuz I ran out....

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: Crisis Quick and Painless Spellbook Filler 2.0 *UPDATED 04-07-2015*
« Reply #8 on: April 07, 2015, 09:18:21 AM »
+1
Looks like this script is coming along nicely....  I read though your code and noticed a couple of logical errors you might want to look into

(a) in your Dragtospellbook sub.   you have "exevent drag #FINDID #FINDSTACK".  Maybe instead of dropping a whole stack of the same spell on a spellbook, you should just drop ONE ie "exevent drag #FINDID 1"    That way you eliminate dropping the rest of the stack on the ground.

(b) Sub Idle  should contain  a  "wait 1"  to actually make the script idle otherwise you are burning tonns of cpu processes looping nothing at a high rate.

(c) You don't have a return statement at the end of  "sub StartMultiSpellbookFiller" or "sub StartSpellbookFiller"  

« Last Edit: April 07, 2015, 09:20:04 AM by Endless Night »
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 CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 2.1 *UPDATED 04-07-2015*
« Reply #9 on: April 07, 2015, 03:55:02 PM »
+1
Thank you EN, I fixed those in version 2.1 which was just uploaded.

Also added in the ability to hardcode the 8 different secures if you store your magery scrolls by spell circle.

I ran this 5 times with secures hardcoded and 5 times setting secures through the setup at the beginning of the script.

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: Crisis Quick and Painless Spellbook Filler 2.1 *UPDATED 04-07-2015*
« Reply #10 on: April 07, 2015, 04:24:53 PM »
+1
Before moving this into the script library I would like to suggest 2 additional improvements.

(a) This is Not necessary for function but would make easier to read and manage...  instead of having 2 copies for the Margery spell settings  you could place all the Margery definitions in its own sub and call it from the 2 places its needed.   Any time you have big blocks of duplicate code its nice to turn it into its own sub.

(b)  StartMultiSpellbookFiller  --  Currently you attempt to pull the scroll from all 8 boxes even tho it should only really be in  one box.  This must slow your script down quiet a bit.    I would recommend one of 2 solutions
     (i)  simple if statment .. if  %n > 0  && %n < 9     (cirlce 1 ) then do the drag from box 1
                                       if  %n > 9  && %n < ??    cirlce 2  then do the drag from box 2 etc
     (ii)  change your dragtospellbook  to have an option to pull from any open bag   ie change "finditem %3 C_ , %1"   to "finditem %3 C"... or if that is too open make it so if queries first   " if %1=anybag  finditem %3 C else finditem %3 C_ , %1"   then in calling code change the 8 dragtospells to 1 gosub with anybag as bagid.

I hope that all makes sense lol

« Last Edit: April 07, 2015, 04:26:54 PM by Endless Night »
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 CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 2.1 *UPDATED 04-07-2015*
« Reply #11 on: April 07, 2015, 05:11:32 PM »
0
Thanks EN, it made a lot of sense and runs more quickly on the multiple containers. I hope that I understood the changes and made them correctly with the IF statements.

Uploaded to version 2.2

Try it out and let me know how it works SUO!

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: Crisis Quick and Painless Spellbook Filler 2.2 *UPDATED 04-07-2015*
« Reply #12 on: April 08, 2015, 09:50:07 AM »
+1
Ok I want to get this script approved so I actually tested it instead of just reading the code  and found an issue and a couple of suggestions:

Testing environment .. single secure with only 5 stacks of spells and 1 empty spellbook

(a) Sort single secure ...... set book set secure... nothing happened.   Problem code in dragtospellbook  
Code: [Select]
 finditem %1 G_2
  if #FINDKIND = -1
    return N/A

This code means if i DO NOT have spells on floor exit.  I never keep my spells on the floor .. you are pulling from secures you should remove this entirely.. you probably had it due to the prior error of pulling the entire stack instead of a single spell resulting in stacks of spells falling to the floor.

Once I removed this code the script functioned perfectly.


(b) You have lots of code in the script that deal with pausing... you dont have a pause button currently are you planning of adding one .. if not remove that code.


(c) Finally I would like to see a status .. ie  Adding spell  %n of  %N_Spells  on the menu even if you just updated the menu title inside the spell %n to %n_spell FOR loops..  "menu Window title %n :  %N_Spells"

eg:
Code: [Select]
for %N 1 %N_Spells ; 1 to the # of spells in the book
{
menu Window title %n :  %N_Spells      ; lets you know whats going on
gosub DragToSpellbook %ScrollSecure %spellbook %scroll . %N ; %Scroll . %N = %Scroll(whatever value N Has)
}


Great work so far....


« Last Edit: April 08, 2015, 09:56:33 AM by Endless Night »
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 CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Crisis Quick and Painless Spellbook Filler 2.2 *UPDATED 04-07-2015*
« Reply #13 on: April 08, 2015, 01:58:15 PM »
+1
Ok I want to get this script approved so I actually tested it instead of just reading the code  and found an issue and a couple of suggestions:

Code: [Select]
[b](b)[/b] You have lots of code in the script that deal with pausing... you dont have a pause button currently are you planning of adding one .. if not remove that code.

The pauses is really just a way to reset it so that it can be used again without pressing stop/start on the EUO client. I can name them something else but I named them pause because basically the script completes the task, and waits for the user to press either single sort or multi sort. I did it so the script could be used over and over until the user was done

I am not sure how else to do that without those. I can name them something different in the code such as reset so it doesn't confuse people. I can be very literal in my thinking and I saw it as a pause but I can see how it could be confused for a pause button on a menu.

Is there a better way of doing it or naming it?
« Last Edit: April 08, 2015, 02:00:22 PM by Crisis »

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: Crisis Quick and Painless Spellbook Filler 2.2 *UPDATED 04-07-2015*
« Reply #14 on: April 08, 2015, 02:26:53 PM »
+1
Ok I want to get this script approved so I actually tested it instead of just reading the code  and found an issue and a couple of suggestions:

Code: [Select]
[b](b)[/b] You have lots of code in the script that deal with pausing... you dont have a pause button currently are you planning of adding one .. if not remove that code.

The pauses is really just a way to reset it so that it can be used again without pressing stop/start on the EUO client. I can name them something else but I named them pause because basically the script completes the task, and waits for the user to press either single sort or multi sort. I did it so the script could be used over and over until the user was done

I am not sure how else to do that without those. I can name them something different in the code such as reset so it doesn't confuse people. I can be very literal in my thinking and I saw it as a pause but I can see how it could be confused for a pause button on a menu.

Is there a better way of doing it or naming it?

Thier are a million ways to skin a cat they say... but  Crisis  only change what you wish to change.. please dont feel pressured to change anything.   The only real requirement to get moved into finished script section is function not how its coded.    I sometimes go over board on my suggestions in an effort to push people forward  but they are suggestions only...

That said.. ver 2.2 breaks if you don't have spells on floor, can you fix that and i will move into approved section.   ;D
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."

Tags: