ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Crisis on June 21, 2014, 11:48:34 AM
-
I am sure that it is something small but I cannot find my mistake. I am trying to take a container filled with mage spell scrolls and drop the stacks on a rune book one by one and then stop. I have not decided what to do if a scroll type is missing but I just wanted to see if it would start trying to drop scrolls and it does nothing after choosing the spellbook and scroll secure. What did I miss?
,----------------------------------------------------
Display Choose the spellbook that you want to fill...
set #targcurs 1
while #targcurs = 1
wait 5
set %spellbook #ltargetID
set #lobjectid %spellbook
wait 10
display Ok Select your Scroll Secure Container...
set #targcurs 1
while #targcurs = 1
wait 5
set %ScrollSecure #ltargetid
set #lobjectid %ScrollSecure
event macro 17 0
wait 20
gosub DragToSpellbook %ScrollSecure %spellbook QXL ;Clumsy
gosub DragToSpellbook %ScrollSecure %spellbook PXL ;Create_Food
gosub DragToSpellbook %ScrollSecure %spellbook AYL ;Feeblemind
gosub DragToSpellbook %ScrollSecure %spellbook ZXL ;Heal
gosub DragToSpellbook %ScrollSecure %spellbook CYL ;Arrow
gosub DragToSpellbook %ScrollSecure %spellbook NXL ;Reactive_Armor
gosub DragToSpellbook %ScrollSecure %spellbook BYL ;Night_Sight
gosub DragToSpellbook %ScrollSecure %spellbook WXL ;Weaken
gosub DragToSpellbook %ScrollSecure %spellbook VXL ;Agility
gosub DragToSpellbook %ScrollSecure %spellbook YXL ;Cunning
gosub DragToSpellbook %ScrollSecure %spellbook XXL ;Cure
gosub DragToSpellbook %ScrollSecure %spellbook IYL ;Harm
gosub DragToSpellbook %ScrollSecure %spellbook HYL ;Magic_Trap
gosub DragToSpellbook %ScrollSecure %spellbook KYL ;Magic_Untrap
gosub DragToSpellbook %ScrollSecure %spellbook JYL ;Protection
gosub DragToSpellbook %ScrollSecure %spellbook EYL ;Strength
gosub DragToSpellbook %ScrollSecure %spellbook DYL ;Bless
gosub DragToSpellbook %ScrollSecure %spellbook GYL ;Fireball
gosub DragToSpellbook %ScrollSecure %spellbook FYL ;Magic_Lock
gosub DragToSpellbook %ScrollSecure %spellbook STL ;Poison
gosub DragToSpellbook %ScrollSecure %spellbook RTL ;Telekinesis
gosub DragToSpellbook %ScrollSecure %spellbook UTL ;Teleport
gosub DragToSpellbook %ScrollSecure %spellbook TTL ;Unlock
gosub DragToSpellbook %ScrollSecure %spellbook OTL ;Wall_of_Stone
gosub DragToSpellbook %ScrollSecure %spellbook NTL ;Arch_Cure
gosub DragToSpellbook %ScrollSecure %spellbook QTL ;Arch_Protection
gosub DragToSpellbook %ScrollSecure %spellbook PTL ;Curse
gosub DragToSpellbook %ScrollSecure %spellbook AUL ;Fire_Field
gosub DragToSpellbook %ScrollSecure %spellbook ZTL ;Greater_Heal
gosub DragToSpellbook %ScrollSecure %spellbook CUL ;Lightning
gosub DragToSpellbook %ScrollSecure %spellbook BUL ;Mana_Drain
gosub DragToSpellbook %ScrollSecure %spellbook WTL ;Recall
gosub DragToSpellbook %ScrollSecure %spellbook VTL ;Blade_Spirits
gosub DragToSpellbook %ScrollSecure %spellbook YTL ;Dispel_Field
gosub DragToSpellbook %ScrollSecure %spellbook XTL ;Incognito
gosub DragToSpellbook %ScrollSecure %spellbook IUL ;Magic_Reflection
gosub DragToSpellbook %ScrollSecure %spellbook HUL ;Mind_Blast
gosub DragToSpellbook %ScrollSecure %spellbook KUL ;Paralyze
gosub DragToSpellbook %ScrollSecure %spellbook JUL ;Poison_Field
gosub DragToSpellbook %ScrollSecure %spellbook EUL ;Summon_Creature
gosub DragToSpellbook %ScrollSecure %spellbook DUL ;Dispel
gosub DragToSpellbook %ScrollSecure %spellbook GUL ;Energy_Bolt
gosub DragToSpellbook %ScrollSecure %spellbook FUL ;Explosion
gosub DragToSpellbook %ScrollSecure %spellbook QUL ;Invisibility
gosub DragToSpellbook %ScrollSecure %spellbook PUL ;Mark
gosub DragToSpellbook %ScrollSecure %spellbook SUL ;Mass_Curse
gosub DragToSpellbook %ScrollSecure %spellbook RUL ;Paralyze Field
gosub DragToSpellbook %ScrollSecure %spellbook MUL ;Reveal
gosub DragToSpellbook %ScrollSecure %spellbook LUL ;Chain_Lightning
gosub DragToSpellbook %ScrollSecure %spellbook OUL ;Energy_Field
gosub DragToSpellbook %ScrollSecure %spellbook NUL ;Flamestrike
gosub DragToSpellbook %ScrollSecure %spellbook YUL ;Gate_Travel
gosub DragToSpellbook %ScrollSecure %spellbook XUL ;Mana_Vampire
gosub DragToSpellbook %ScrollSecure %spellbook AVL ;Mass_Dispel
gosub DragToSpellbook %ScrollSecure %spellbook UUL ;Polymorph
gosub DragToSpellbook %ScrollSecure %spellbook ZUL ;Meteor_Swarm
gosub DragToSpellbook %ScrollSecure %spellbook TUL ;Earthquake
gosub DragToSpellbook %ScrollSecure %spellbook WUL ;Energy_Vortex
gosub DragToSpellbook %ScrollSecure %spellbook VUL ;Resurrection
gosub DragToSpellbook %ScrollSecure %spellbook GVL ;Air_Elemental
gosub DragToSpellbook %ScrollSecure %spellbook FVL ;Summon_Daemon
gosub DragToSpellbook %ScrollSecure %spellbook IVL ;Earth_Elemental
gosub DragToSpellbook %ScrollSecure %spellbook HVL ;Fire_Elemental
gosub DragToSpellbook %ScrollSecure %spellbook CVL ;Water_Elemental
,----------------------------------------------------
sub DragToSpellbook
set %ScrollSecure %1
set %spellbook %2
set %scrolls %3
finditem %SpellSecure G_2
if #FINDKIND = -1
return N/A
DragToSpellbook_loop1:
finditem %scrolls C_ , %ScrollSecure
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %spellbook
wait 10
goto DragToSpellbook_loop1
}
return
,----------------------------------------------------
;-------------------------------------------------
; %1 = GumpWait
; %2 = Gumpname 1
; %3 = Gumpname 2
sub GumpWait
wait 10
set %timedelay #SCNT
loopwait1:
if #CONTNAME = %1 || #CONTNAME = %2
return
if #SCNT > %timedelay + 7
return
goto loopwait1
return
-
Didn't I read somewhere that dropc doesn't work on things like the paperdoll and spellbooks anymore?
-
Okay I am a doofus and I found the mistake that I knew had to be there. I originally was going with %SpellSecure and then decided to change it to %ScrollSecure. I missed the part with it in there.
finditem %SpellSecure G_2
if #FINDKIND = -1
return N/A
DragToSpellbook_loop1:
finditem %scrolls C_ , %ScrollSecure
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %spellbook
wait 10
It will now drop a couple of scrolls into a book and then it gets stuck and keeps trying to pick up and drop the same spell over and over. I thought by listing each spell seperately, it would only try each one once. I know I will need to put some kind of stop in there after the final scroll but I am working on one problem at a time lol.
-
Exevent Droppd Works for papredolls on humans and Elves, but not Gargoyles. looking over the code now.
-
Try using
if #Findcnt > 0 instead of if #Findkind <> -1 don't think that will fix it, just less confusing.
You also Have a Redundancy and an Infinite Loop
sub DragToSpellbook
set %ScrollSecure %1 ; <- %ScrollSecure is already %ScrollSecure Just Remove this part and use %1 as your Secure
set %spellbook %2 ;<- %SpellBook is already %SpellBook Just remove this part and use %2 as your Spellbook
set %scrolls %3
finditem %SpellSecure G_2
if #FINDKIND = -1
return N/A
DragToSpellbook_loop1:
finditem %scrolls C_ , %ScrollSecure
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %spellbook
wait 10
goto DragToSpellbook_loop1 ;<- Infinite Loop so long as the scrolls are found in the bag.
}
return
-
I edited my 2nd post without making sure that no one had replied. If you go up you will see the mistake that I made so it is working to an extent but now it is looping in the same spell over and over. It will drop 2 different spells in and then sticks on the 3rd one.
I know the loop is there but I wanted to make sure that it would try each scroll before stopping. I wanted to test it before removing the loop. I appreciate you taking the time to look at it.
Do I need to name the scrolls differently at the beginning so that the %3 step will work better?
-
I changed the %ScrollSecure %1 to just %1 and the %Spellbook %2 to just %2 and it seems to flowing smoothly now. I also removed the loop and added a halt after the last spell. I have plans to use this in another script but this works perfect for me right now to fill spellbooks from all of my stacks of extra spells. Thanks!!
-
No Problem. You could also Make this Work for Necro and Mysticism Spells. But you have to learn about parsing (sp) and Building arrays with Euo.
So, Lets say they target the Book
set %Mage_Book XXX
set %Necro_Book XXX
set %Myst_Book XXX
if %SpellBook = %Mage_Book
{
set %N_Spells 64 ;<- Defining the Size of the array
set %Scroll1 QXL
set %Scroll2 PXL
set %Scroll3 ZXL
set %Scroll4 CYL
; etc etc etc
}
if %SpellBook = %Necro_Book
{
set %N_Spells 17
set %Scroll1
set %Scroll2
set %Scroll3
; etc etc etc
}
Then when it comes time to fill you do this
for %N 1 %N_Spell ; 1 to the # of spells in the book
{
gosub DragToSpellbook %ScrollSecure %spellbook %Scroll . %N ; %Scroll . %N = %Scroll(whatever value N Has)
}
-
I like that, I think I will play around with it and see if I can get it to work that way as well.
-
Okay here is what I have. I must have missed something again because it is just sitting idle after choosing the book and the scroll secure. I am wondering if it has to to do with the gosub dragtospellbook and the actual sub. Is it not recognizing the scrolls?
Display Choose the spellbook that you want to fill...
set #targcurs 1
while #targcurs = 1
wait 5
set %spellbook #ltargetID
set #lobjectid %spellbook
wait 10
display Select your Scroll Secure Container...
set #targcurs 1
while #targcurs = 1
wait 5
set %ScrollSecure #ltargetid
set #lobjectid %ScrollSecure
event macro 17 0
wait 20
set %Mage_Book MPF
set %Necro_Book XXM
set %Myst_Book RGR_RJR
if %SpellBook = %Mage_Book
{
set %N_Spells 64 ;<- Defining the Size of the array
; 1st Circle Spells
set %scroll1 QXL ;Clumsy
set %scroll2 PXL ;Create Food
set %scroll3 AYL ;Feeblemind
set %scroll4 ZXL ;Heal
set %scroll5 CYL ;Magic Arrow
set %scroll6 BYL ;Night Sight
set %scroll7 NXL ;Reactive Armor
set %scroll8 WXL ;Weaken
; 2nd Circle Spells
set %scroll9 VXL ;Agility
set %scroll10 YXL ;Cunning
set %scroll11 XXL ;Cure
set %scroll12 IYL ;Harm
set %scroll13 HYL ;Magic Trap
set %scroll14 KYL ;Magic Untrap
set %scroll15 JYL ;Protection
set %scroll16 EYL ;Strength
; 3rd Circle Spells
set %scroll17 DYL ;Bless
set %scroll18 GYL ;Fireball
set %scroll19 FYL ;Magic Lock
set %scroll20 STL ;Poison
set %scroll21 RTL ;Telekinesis
set %scroll22 UTL ;Teleport
set %scroll23 TTL ;Unlock
set %scroll24 OTL ;Wall of Stone
; 4th Circle Spells
set %scroll25 NTL ;Arch Cure
set %scroll26 QTL ;Arch Protection
set %scroll27 PTL ;Curse
set %scroll28 AUL ;Fire Field
set %scroll29 ZTL ;Greater Heal
set %scroll30 CUL ;Lightning
set %scroll31 BUL ;Mana Drain
set %scroll32 WTL ;Recall
; 5th Circle Spells
set %scroll33 VTL ;Blade Spirits
set %scroll34 YTL ;Dispel Field
set %scroll35 XTL ;Incognito
set %scroll36 IUL ;Magic Reflection
set %scroll37 HUL ;Mind Blast
set %scroll38 KUL ;Paralyze
set %scroll39 JUL ;Poison Field
set %scroll40 EUL ;Summon Creature
; 6th Circle Spells
set %scroll41 DUL ;Dispel
set %scroll42 GUL ;Energy Bolt
set %scroll43 FUL ;Explosion
set %scroll44 QUL ;Invisibility
set %scroll45 PUL ;Mark
set %scroll46 SUL ;Mass Curse
set %scroll47 RUL ;Paralyze Field
set %scroll48 MUL ;Reveal
; 7th Circle Spells
set %scroll49 LUL ;Chain Lightning
set %scroll50 OUL ;Energy Field
set %scroll51 NUL ;Flamestrike
set %scroll52 YUL ;Gate Travel
set %scroll53 XUL ;Mana Vampire
set %scroll54 AVL ;Mass Dispell
set %scroll55 ZUL ;Meteor Swarm
set %scroll56 UUL ;Polymorph
; 8th Circle Spells
set %scroll57 TUL ;Earthquake
set %scroll58 WUL ;Energy Vortex
set %scroll59 VUL ;Resurrection
set %scroll60 GVL ;Summon Air Elemental
set %scroll61 FVL ;Summon Daemon
set %scroll62 IVL ;Summon Earth Elemental
set %scroll63 HVL ;Summon Fire Elemental
set %scroll64 CVL ;Summon Water Elemental
}
if %SpellBook = %Necro_Book
{
set %N_Spells 17
set %scroll1 MYM ;Animate Dead
set %scroll2 LYM ;Blood Oath
set %scroll3 OYM ;Corpse Skin
set %scroll4 NYM;Curse Weapon
set %scroll5 IYM ;Evil Omen
set %scroll6 HYM ;Horrific Beast
set %scroll7 KYM ;Lich Form
set %scroll8 JYM ;Mind Rot
set %scroll9 UYM ;Pain Spike
set %scroll10 TYM ;Poison Strike
set %scroll11 WYM ;Strangle
set %scroll12 VYM ;Summon Familiar
set %scroll13 QYM ;Vampiric Embrace
set %scroll14 PYM ;Vengeful Spirit
set %scroll15 SYM ;Wither
set %scroll16 RYM ;Wraith Form
set %scroll17 CZM ;Exorcism
}
if %SpellBook = %Myst_Book
[
set %N_Spells 16
set %scroll1 AKR ;Animated Weapon
set %scroll2 LKR ;Bombard
set %scroll3 MKR ;Cleansing Wind
set %scroll4 FKR ;Eagle Strike
set %scroll5 DKR ;enchant
set %scroll6 NKR ;Hail Storm
set %scroll7 TJR ;Healing Stone
set %scroll8 BKR ;Mass Sleep
set %scroll9 UJR ;Nether Bolt
set %scroll10 IKR ;Nether Cyclone
set %scroll11 EKR ;Purge Magic
set %scroll12 HKR ;Rising Colossus
set %scroll13 GKR ;Sleep
set %scroll14 GKR ;Spell Plague
set %scroll15 CKR ;Spell Trigger
set %scroll16 ZJR ;Stone Form
]
for %N 1 %N_Spells ; 1 to the # of spells in the book
{
gosub DragToSpellbook %ScrollSecure %spellbook %scroll . %N ; %Scroll . %N = %Scroll(whatever value N Has)
}
;===================================================================
sub DragToSpellbook
set %1
set %2
set %scroll %3
finditem %ScrollSecure G_2
if #FINDKIND = -1
return N/A
finditem %scroll C_ , %ScrollSecure
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %spellbook
wait 10
}
return
-
So, When you Use a gosub it automatically sets what you put after the sub name to the Variables.
Gosub Test 1 2 3 4 5 6 7 8 9
Sub Test
Display %1 %2 %3 %4 %5 %6 %7 %8 %9
Return
In your sub when you use
set %1
set %2
You are literally overwriting What %1 and %2 are, and replacing them with a blank.
-
Hah, we also missed something else. My bad. We need tog et the #Findtype for the spellbook to compare to the Types for the different books.
Display Choose the spellbook that you want to fill...
set #targcurs 1
while #targcurs = 1
wait 5
set %spellbook #ltargetID
Finditem %SpellBook
set %BookType #Findtype ; <- Got the "Type" For the Book.
if %BookType in %Mage_book
{
}
if %BookType in %Necro_Book
{
}
if %BookType in %Myst_Book
{
}
The reason we changed from the "=" to "in" Comparison is because you put that there are multiple types of myst Books.
-
So, When you Use a gosub it automatically sets what you put after the sub name to the Variables.
Gosub Test 1 2 3 4 5 6 7 8 9
Sub Test
Display %1 %2 %3 %4 %5 %6 %7 %8 %9
Return
In your sub when you use
set %1
set %2
You are literally overwriting What %1 and %2 are, and replacing them with a blank.
I think I understand what you are saying and but not sure I am understanding how to fix it.
So instead of
sub DragToSpellbook
set %1
set %2
set %scroll %3
It should be this?
sub DragToSpellbook
set %ScrollSecure
set %spellbook
set %scroll
Hah, we also missed something else. My bad. We need tog et the #Findtype for the spellbook to compare to the Types for the different books.
Display Choose the spellbook that you want to fill...
set #targcurs 1
while #targcurs = 1
wait 5
set %spellbook #ltargetID
Finditem %SpellBook
set %BookType #Findtype ; <- Got the "Type" For the Book.
if %BookType in %Mage_book
{
}
if %BookType in %Necro_Book
{
}
if %BookType in %Myst_Book
{
}
The reason we changed from the "=" to "in" Comparison is because you put that there are multiple types of myst Books.
I understand these changes, thank you for explaining why it needs to be changed. That is extremely helpful in learning!
Here is what I did and I tried it a coupe of different ways with the %1 %2 %3 but still nothing happens after choosing spellbook and secure
Display Choose the spellbook that you want to fill...
set #targcurs 1
while #targcurs = 1
wait 5
set %spellbook #ltargetID
Finditem %spellbook
set %BookType #Findtype
wait 10
display Select your Scroll Secure Container...
set #targcurs 1
while #targcurs = 1
wait 5
set %ScrollSecure #ltargetid
set #lobjectid %ScrollSecure
event macro 17 0
wait 20
set %Mage_Book MPF
set %Necro_Book XXM
set %Myst_Book RGR_RJR
if %SpellBook in %Mage_Book
{
set %N_Spells 64 ;<- Defining the Size of the array
; 1st Circle Spells
set %scroll1 QXL ;Clumsy
set %scroll2 PXL ;Create Food
set %scroll3 AYL ;Feeblemind
set %scroll4 ZXL ;Heal
set %scroll5 CYL ;Magic Arrow
set %scroll6 BYL ;Night Sight
set %scroll7 NXL ;Reactive Armor
set %scroll8 WXL ;Weaken
; 2nd Circle Spells
set %scroll9 VXL ;Agility
set %scroll10 YXL ;Cunning
set %scroll11 XXL ;Cure
set %scroll12 IYL ;Harm
set %scroll13 HYL ;Magic Trap
set %scroll14 KYL ;Magic Untrap
set %scroll15 JYL ;Protection
set %scroll16 EYL ;Strength
; 3rd Circle Spells
set %scroll17 DYL ;Bless
set %scroll18 GYL ;Fireball
set %scroll19 FYL ;Magic Lock
set %scroll20 STL ;Poison
set %scroll21 RTL ;Telekinesis
set %scroll22 UTL ;Teleport
set %scroll23 TTL ;Unlock
set %scroll24 OTL ;Wall of Stone
; 4th Circle Spells
set %scroll25 NTL ;Arch Cure
set %scroll26 QTL ;Arch Protection
set %scroll27 PTL ;Curse
set %scroll28 AUL ;Fire Field
set %scroll29 ZTL ;Greater Heal
set %scroll30 CUL ;Lightning
set %scroll31 BUL ;Mana Drain
set %scroll32 WTL ;Recall
; 5th Circle Spells
set %scroll33 VTL ;Blade Spirits
set %scroll34 YTL ;Dispel Field
set %scroll35 XTL ;Incognito
set %scroll36 IUL ;Magic Reflection
set %scroll37 HUL ;Mind Blast
set %scroll38 KUL ;Paralyze
set %scroll39 JUL ;Poison Field
set %scroll40 EUL ;Summon Creature
; 6th Circle Spells
set %scroll41 DUL ;Dispel
set %scroll42 GUL ;Energy Bolt
set %scroll43 FUL ;Explosion
set %scroll44 QUL ;Invisibility
set %scroll45 PUL ;Mark
set %scroll46 SUL ;Mass Curse
set %scroll47 RUL ;Paralyze Field
set %scroll48 MUL ;Reveal
; 7th Circle Spells
set %scroll49 LUL ;Chain Lightning
set %scroll50 OUL ;Energy Field
set %scroll51 NUL ;Flamestrike
set %scroll52 YUL ;Gate Travel
set %scroll53 XUL ;Mana Vampire
set %scroll54 AVL ;Mass Dispell
set %scroll55 ZUL ;Meteor Swarm
set %scroll56 UUL ;Polymorph
; 8th Circle Spells
set %scroll57 TUL ;Earthquake
set %scroll58 WUL ;Energy Vortex
set %scroll59 VUL ;Resurrection
set %scroll60 GVL ;Summon Air Elemental
set %scroll61 FVL ;Summon Daemon
set %scroll62 IVL ;Summon Earth Elemental
set %scroll63 HVL ;Summon Fire Elemental
set %scroll64 CVL ;Summon Water Elemental
}
if %SpellBook in %Necro_Book
{
set %N_Spells 17
set %scroll1 MYM ;Animate Dead
set %scroll2 LYM ;Blood Oath
set %scroll3 OYM ;Corpse Skin
set %scroll4 NYM;Curse Weapon
set %scroll5 IYM ;Evil Omen
set %scroll6 HYM ;Horrific Beast
set %scroll7 KYM ;Lich Form
set %scroll8 JYM ;Mind Rot
set %scroll9 UYM ;Pain Spike
set %scroll10 TYM ;Poison Strike
set %scroll11 WYM ;Strangle
set %scroll12 VYM ;Summon Familiar
set %scroll13 QYM ;Vampiric Embrace
set %scroll14 PYM ;Vengeful Spirit
set %scroll15 SYM ;Wither
set %scroll16 RYM ;Wraith Form
set %scroll17 CZM ;Exorcism
}
if %SpellBook in %Myst_Book
[
set %N_Spells 16
set %scroll1 AKR ;Animated Weapon
set %scroll2 LKR ;Bombard
set %scroll3 MKR ;Cleansing Wind
set %scroll4 FKR ;Eagle Strike
set %scroll5 DKR ;enchant
set %scroll6 NKR ;Hail Storm
set %scroll7 TJR ;Healing Stone
set %scroll8 BKR ;Mass Sleep
set %scroll9 UJR ;Nether Bolt
set %scroll10 IKR ;Nether Cyclone
set %scroll11 EKR ;Purge Magic
set %scroll12 HKR ;Rising Colossus
set %scroll13 GKR ;Sleep
set %scroll14 GKR ;Spell Plague
set %scroll15 CKR ;Spell Trigger
set %scroll16 ZJR ;Stone Form
]
for %N 1 %N_Spells ; 1 to the # of spells in the book
{
gosub DragToSpellbook %ScrollSecure %spellbook %scroll . %N ; %Scroll . %N = %Scroll(whatever value N Has)
}
;===================================================================
sub DragToSpellbook
set %ScrollSecure
set %spellbook
set %scroll
finditem %ScrollSecure G_2
if #FINDKIND = -1
return N/A
finditem %scroll C_ , %ScrollSecure
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %spellbook
wait 10
}
return
-
So, When you use the command
gosub DragToSpellbook %ScrollSecure %spellbook %scroll . %N
It Automatically Does this on its own
set %1 %ScrollSecure
set %2 %Spellbook
set %3 %Scroll . %N
sub DragToSpellbook
finditem %1 G_2
if #FINDKIND = -1
return N/A
finditem %3 C_ , %1
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %2
wait 10
}
return
-
It makes a lot of sense and I totally understand it but it isn't working and that is so frustrating lol
Could I have made any typos in setting up the scrolls or anything? Does it matter that all 3 types have %scroll1 %scroll2 etc? I am guessing not because they are defined by the book and the number of scrolls in the book, right?
Display Choose the spellbook that you want to fill...
set #targcurs 1
while #targcurs = 1
wait 5
set %spellbook #ltargetID
set #lobjectid %spellbook
wait 10
display Select your Scroll Secure Container...
set #targcurs 1
while #targcurs = 1
wait 5
set %ScrollSecure #ltargetid
set #lobjectid %ScrollSecure
event macro 17 0
wait 20
set %Mage_Book MPF
set %Necro_Book XXM
set %Myst_Book RGR_RJR
if %spellbook in %Mage_Book
{
set %N_Spells 64 ;<- Defining the Size of the array
; 1st Circle Spells
set %scroll1 QXL ;Clumsy
set %scroll2 PXL ;Create Food
set %scroll3 AYL ;Feeblemind
set %scroll4 ZXL ;Heal
set %scroll5 CYL ;Magic Arrow
set %scroll6 BYL ;Night Sight
set %scroll7 NXL ;Reactive Armor
set %scroll8 WXL ;Weaken
; 2nd Circle Spells
set %scroll9 VXL ;Agility
set %scroll10 YXL ;Cunning
set %scroll11 XXL ;Cure
set %scroll12 IYL ;Harm
set %scroll13 HYL ;Magic Trap
set %scroll14 KYL ;Magic Untrap
set %scroll15 JYL ;Protection
set %scroll16 EYL ;Strength
; 3rd Circle Spells
set %scroll17 DYL ;Bless
set %scroll18 GYL ;Fireball
set %scroll19 FYL ;Magic Lock
set %scroll20 STL ;Poison
set %scroll21 RTL ;Telekinesis
set %scroll22 UTL ;Teleport
set %scroll23 TTL ;Unlock
set %scroll24 OTL ;Wall of Stone
; 4th Circle Spells
set %scroll25 NTL ;Arch Cure
set %scroll26 QTL ;Arch Protection
set %scroll27 PTL ;Curse
set %scroll28 AUL ;Fire Field
set %scroll29 ZTL ;Greater Heal
set %scroll30 CUL ;Lightning
set %scroll31 BUL ;Mana Drain
set %scroll32 WTL ;Recall
; 5th Circle Spells
set %scroll33 VTL ;Blade Spirits
set %scroll34 YTL ;Dispel Field
set %scroll35 XTL ;Incognito
set %scroll36 IUL ;Magic Reflection
set %scroll37 HUL ;Mind Blast
set %scroll38 KUL ;Paralyze
set %scroll39 JUL ;Poison Field
set %scroll40 EUL ;Summon Creature
; 6th Circle Spells
set %scroll41 DUL ;Dispel
set %scroll42 GUL ;Energy Bolt
set %scroll43 FUL ;Explosion
set %scroll44 QUL ;Invisibility
set %scroll45 PUL ;Mark
set %scroll46 SUL ;Mass Curse
set %scroll47 RUL ;Paralyze Field
set %scroll48 MUL ;Reveal
; 7th Circle Spells
set %scroll49 LUL ;Chain Lightning
set %scroll50 OUL ;Energy Field
set %scroll51 NUL ;Flamestrike
set %scroll52 YUL ;Gate Travel
set %scroll53 XUL ;Mana Vampire
set %scroll54 AVL ;Mass Dispell
set %scroll55 ZUL ;Meteor Swarm
set %scroll56 UUL ;Polymorph
; 8th Circle Spells
set %scroll57 TUL ;Earthquake
set %scroll58 WUL ;Energy Vortex
set %scroll59 VUL ;Resurrection
set %scroll60 GVL ;Summon Air Elemental
set %scroll61 FVL ;Summon Daemon
set %scroll62 IVL ;Summon Earth Elemental
set %scroll63 HVL ;Summon Fire Elemental
set %scroll64 CVL ;Summon Water Elemental
}
if %spellbook in %Necro_Book
{
set %N_Spells 17
set %scroll1 MYM ;Animate Dead
set %scroll2 LYM ;Blood Oath
set %scroll3 OYM ;Corpse Skin
set %scroll4 NYM;Curse Weapon
set %scroll5 IYM ;Evil Omen
set %scroll6 HYM ;Horrific Beast
set %scroll7 KYM ;Lich Form
set %scroll8 JYM ;Mind Rot
set %scroll9 UYM ;Pain Spike
set %scroll10 TYM ;Poison Strike
set %scroll11 WYM ;Strangle
set %scroll12 VYM ;Summon Familiar
set %scroll13 QYM ;Vampiric Embrace
set %scroll14 PYM ;Vengeful Spirit
set %scroll15 SYM ;Wither
set %scroll16 RYM ;Wraith Form
set %scroll17 CZM ;Exorcism
}
if %spellbook in %Myst_Book
[
set %N_Spells 16
set %scroll1 AKR ;Animated Weapon
set %scroll2 LKR ;Bombard
set %scroll3 MKR ;Cleansing Wind
set %scroll4 FKR ;Eagle Strike
set %scroll5 DKR ;enchant
set %scroll6 NKR ;Hail Storm
set %scroll7 TJR ;Healing Stone
set %scroll8 BKR ;Mass Sleep
set %scroll9 UJR ;Nether Bolt
set %scroll10 IKR ;Nether Cyclone
set %scroll11 EKR ;Purge Magic
set %scroll12 HKR ;Rising Colossus
set %scroll13 GKR ;Sleep
set %scroll14 GKR ;Spell Plague
set %scroll15 CKR ;Spell Trigger
set %scroll16 ZJR ;Stone Form
]
for %N 1 %N_Spells ; 1 to the # of spells in the book
{
gosub DragToSpellbook %ScrollSecure %spellbook %scroll . %N ; %Scroll . %N = %Scroll(whatever value N Has)
}
;===================================================================
sub DragToSpellbook
set %1 %ScrollSecure
set %2 %spellbook
set %3 %scroll . %N
finditem %1 G_2
if #FINDKIND = -1
return N/A
finditem %3 C_ , %1
if #FINDKIND <> -1
{
exevent drag #FINDID #FINDSTACK
wait 10
exevent dropc %2
wait 10
}
return
-
Oh, okay you missed the Part about the Types
if %spellbook in %Mage_Book
%SpellBook is the ID for the Book, not the Type which is what we are comparing when we look.
And Delete these lines. Trying to explain that they are already set when you use the gosub.
set %1 %ScrollSecure
set %2 %spellbook
set %3 %scroll . %N
You can see it with this little snippet of code
Gosub Test This is a test
Halt
Sub Test
Display %1 %2 %3 %4
Return
When you use a gosub, it automatically sets %1 %2 %3 %4 %5 etc etc etc
-
OMG I am an doofus! I did see the booktype and thought I had changed it but my power cut out while I was testing and I forgot to go back and re-change it.
I did not realize that I needed to take out those other lines, I thought you meant by having just the %1 there, that it did not know what to do. I did not realize it needed to go. Thank you, working like a charm and I learned a lot from this one! ;D