Description: Finds all spell scrolls in backpack and adds them to spellbook via context menu , already added scrolls are dropped to ground , added spells are shown via overhead message
# ITEM Add Spell Scrolls to Spellbook - a Razor Community Edition script for Ultima Online Classic
# Finds all spell scrolls in backpack and adds them to spellbook via context menu
# already added scrolls are dropped to ground, newly added spells are shown in overhead message
# =============================================================================
# CONFIGURATION: Set to 1 to SKIP a circle (dropping scrolls to ground ), 0 will try adding scrolls of that circle
# =============================================================================
@setvar! skip_circle_1 0
@setvar! skip_circle_2 0
@setvar! skip_circle_3 0
@setvar! skip_circle_4 0
@setvar! skip_circle_5 0
@setvar! skip_circle_6 0
@setvar! skip_circle_7 0
@setvar! skip_circle_8 0
# =============================================================================
clearignore
removelist spell_circle_1
removelist spell_circle_2
removelist spell_circle_3
removelist spell_circle_4
removelist spell_circle_5
removelist spell_circle_6
removelist spell_circle_7
removelist spell_circle_8
#overhead "Add Spell Scroll Script START" 88
#overhead "Step 1: Finding spellbook in backpack..." 77
if findtype 0x0EFA backpack as myspellbook
@setvar! spellbook myspellbook
#overhead "Spellbook found!" 88
else
overhead "ERROR: No spellbook found in backpack!" 33
stop
endif
#overhead "Processing scrolls..." 77
# Circle 1 scrolls (0x1F2D - 0x1F34)
createlist spell_circle_1
pushlist spell_circle_1 0x1F2D
pushlist spell_circle_1 0x1F2E
pushlist spell_circle_1 0x1F2F
pushlist spell_circle_1 0x1F30
pushlist spell_circle_1 0x1F31
pushlist spell_circle_1 0x1F32
pushlist spell_circle_1 0x1F33
pushlist spell_circle_1 0x1F34
# Circle 2 scrolls (0x1F35 - 0x1F3C)
createlist spell_circle_2
pushlist spell_circle_2 0x1F35
pushlist spell_circle_2 0x1F36
pushlist spell_circle_2 0x1F37
pushlist spell_circle_2 0x1F38
pushlist spell_circle_2 0x1F39
pushlist spell_circle_2 0x1F3A
pushlist spell_circle_2 0x1F3B
pushlist spell_circle_2 0x1F3C
# Circle 3 scrolls (0x1F3D - 0x1F44)
createlist spell_circle_3
pushlist spell_circle_3 0x1F3D
pushlist spell_circle_3 0x1F3E
pushlist spell_circle_3 0x1F3F
pushlist spell_circle_3 0x1F40
pushlist spell_circle_3 0x1F41
pushlist spell_circle_3 0x1F42
pushlist spell_circle_3 0x1F43
pushlist spell_circle_3 0x1F44
# Circle 4 scrolls (0x1F45 - 0x1F4C)
createlist spell_circle_4
pushlist spell_circle_4 0x1F45
pushlist spell_circle_4 0x1F46
pushlist spell_circle_4 0x1F47
pushlist spell_circle_4 0x1F48
pushlist spell_circle_4 0x1F49
pushlist spell_circle_4 0x1F4A
pushlist spell_circle_4 0x1F4B
pushlist spell_circle_4 0x1F4C
# Circle 5 scrolls (0x1F4D - 0x1F54)
createlist spell_circle_5
pushlist spell_circle_5 0x1F4D
pushlist spell_circle_5 0x1F4E
pushlist spell_circle_5 0x1F4F
pushlist spell_circle_5 0x1F50
pushlist spell_circle_5 0x1F51
pushlist spell_circle_5 0x1F52
pushlist spell_circle_5 0x1F53
pushlist spell_circle_5 0x1F54
# Circle 6 scrolls (0x1F55 - 0x1F5C)
createlist spell_circle_6
pushlist spell_circle_6 0x1F55
pushlist spell_circle_6 0x1F56
pushlist spell_circle_6 0x1F57
pushlist spell_circle_6 0x1F58
pushlist spell_circle_6 0x1F59
pushlist spell_circle_6 0x1F5A
pushlist spell_circle_6 0x1F5B
pushlist spell_circle_6 0x1F5C
# Circle 7 scrolls (0x1F5D - 0x1F64)
createlist spell_circle_7
pushlist spell_circle_7 0x1F5D
pushlist spell_circle_7 0x1F5E
pushlist spell_circle_7 0x1F5F
pushlist spell_circle_7 0x1F60
pushlist spell_circle_7 0x1F61
pushlist spell_circle_7 0x1F62
pushlist spell_circle_7 0x1F63
pushlist spell_circle_7 0x1F64
# Circle 8 scrolls (0x1F65 - 0x1F6C)
createlist spell_circle_8
pushlist spell_circle_8 0x1F65
pushlist spell_circle_8 0x1F66
pushlist spell_circle_8 0x1F67
pushlist spell_circle_8 0x1F68
pushlist spell_circle_8 0x1F69
pushlist spell_circle_8 0x1F6A
pushlist spell_circle_8 0x1F6B
pushlist spell_circle_8 0x1F6C
# =============================================================================
# Magery Circle 1
# =============================================================================
if skip_circle_1 = 1
#overhead "Circle 1: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_1
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc 0 -1
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 1: Processing..." 77
foreach spell_scroll_id in spell_circle_1
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc 0 -1
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 2
# =============================================================================
if skip_circle_2 = 1
#overhead "Circle 2: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_2
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc 1 -1
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 2: Processing..." 77
foreach spell_scroll_id in spell_circle_2
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc 1 -1
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 3
# =============================================================================
if skip_circle_3 = 1
#overhead "Circle 3: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_3
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc 1 0
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 3: Processing..." 77
foreach spell_scroll_id in spell_circle_3
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc 1 0
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 4
# =============================================================================
if skip_circle_4 = 1
#overhead "Circle 4: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_4
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc 1 1
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 4: Processing..." 77
foreach spell_scroll_id in spell_circle_4
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc 0 1
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 5
# =============================================================================
if skip_circle_5 = 1
#overhead "Circle 5: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_5
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc 0 1
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 5: Processing..." 77
foreach spell_scroll_id in spell_circle_5
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc 0 1
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 6
# =============================================================================
if skip_circle_6 = 1
#overhead "Circle 6: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_6
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc -1 1
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 6: Processing..." 77
foreach spell_scroll_id in spell_circle_6
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc -1 1
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 7
# =============================================================================
if skip_circle_7 = 1
#overhead "Circle 7: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_7
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc -1 0
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 7: Processing..." 77
foreach spell_scroll_id in spell_circle_7
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc -1 0
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
# =============================================================================
# Magery Circle 8
# =============================================================================
if skip_circle_8 = 1
#overhead "Circle 8: SKIPPING (dropping scrolls)" 48
foreach spell_scroll_id in spell_circle_8
while findtype spell_scroll_id backpack as scroll
lift scroll
getlabel backpack ping
droprelloc -1 -1
getlabel backpack ping
endwhile
endfor
else
#overhead "Circle 8: Processing..." 77
foreach spell_scroll_id in spell_circle_8
while findtype spell_scroll_id backpack as scroll
getlabel scroll scrollname
clearsysmsg
#overhead "Adding scroll via context menu..." 77
menu scroll 0
wft 5000
if targetexists
#overhead "Targeting spellbook..." 77
target! spellbook
getlabel backpack ping
endif
getlabel backpack ping
if insysmsg "already present in that spellbook" or insysmsg "already has that spell"
#overhead "Duplicate - dropping" 48
lift scroll
getlabel backpack ping
droprelloc -1 -1
getlabel backpack ping
else
overhead scrollname 88
endif
getlabel backpack ping
endwhile
endfor
endif
#overhead "All scrolls processed!" 88
Version History
Version 2 - 1/26/2026, 2:31:52 PM - 4 days ago
ITEM_Add_Scrolls_to_Spellbook
Version 1 - 1/26/2026, 1:51:11 PM - 4 days ago
ITEM_Add_Scrolls_to_Spellbook
Original Version Saved - 1/26/2026, 1:50:42 AM - 4 days ago