Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 73 additions & 60 deletions scripts/familiar.lic
Original file line number Diff line number Diff line change
@@ -1,65 +1,78 @@
=begin
Familiar Upkeep Script
A simple script to keep your familiar alive and active.
Waits for the link to weaken and then refreshes 920.
Currently set to refresh when at 15 minutes.
https://github.com/elanthia-online/scripts/
Familiar Upkeep Script
A simple script to keep your familiar alive and active.
Waits for the link to weaken and then refreshes 920.
Currently set to refresh when at 15 minutes.
https://github.com/elanthia-online/scripts/

SYNTAX - ;familiar
SYNTAX - ;familiar

--allowmove=<OFF/ON>
Disables move on fizzle/interference
--allowmove=<YES/NO>
Disables move on fizzle/interference

--refreshtimer=#
Sets refresh timer (defaults to 15)
--refreshtimer=#
Sets refresh timer (defaults to 15)

todo: none
author: Tysong (horibu on PC)
name: familiar
tags: familiar, 920, wizard
version: 1.45
author: elanthia online
Contributors: Tysong, Dissonance
name: familiar
tags: familiar, 920, wizard
version: 1.46.0

changelog:
1.45 (2024-05-06)
Add support for ewaggle
Change checkmana to Char.mana call
1.44 (2023-06-05)
Fix for Lich 5.7.0 infomon update
rubocop cleanup
1.43 (2022-03-09)
change to use Effects
1.42 (2018-10-07)
fixed bug in checkmana being 5 instead of 20
1.41 (2018-10-05)
fixed bug in logic of --allowmove being backwards
1.4 (2018-08-20)
Added additional interference detection
Added option to not move away from room on fizzle/interfence, pauses script
Added option to set refresh timer (defaults to 15)
changelog:
1.46.0 (2025-12-28)
Added check that 920 is known before attempting to cast to prevent infinite error loop.
Fixed header format and version formatting.
Updated to more current scripting standards.
removed hide_me, no reason to hide script
1.45 (2024-05-06)
Add support for ewaggle
Change checkmana to Char.mana call
1.44 (2023-06-05)
Fix for Lich 5.7.0 infomon update
rubocop cleanup
1.43 (2022-03-09)
change to use Effects
1.42 (2018-10-07)
fixed bug in checkmana being 5 instead of 20
1.41 (2018-10-05)
fixed bug in logic of --allowmove being backwards
1.4 (2018-08-20)
Added additional interference detection
Added option to not move away from room on fizzle/interfence, pauses script
Added option to set refresh timer (defaults to 15)

special thanks:
Original author Annelie and tweaks by sele
special thanks:
Original author Annelie and tweaks by sele
=end

no_pause_all
no_kill_all
hide_me

UserVars.familiar ||= {}
UserVars.familiar[:allow_move] = true if UserVars.familiar[:allow_move].nil?
UserVars.familiar[:refresh_timer] = 15.0 if UserVars.familiar[:refresh_timer].nil?
UserVars.familiar[:allow_move] = true if UserVars.familiar[:allow_move].nil?
UserVars.familiar[:refresh_timer] = 15.0 if UserVars.familiar[:refresh_timer].nil?

if variable[1] && variable[1].downcase == "help"
echo "This script will automatically refresh your familiar once you are under 15mins."
echo "Start script by doing ;familiar"
echo ""
echo "Optional arguments:"
echo " ;familiar --allowmove=off"
echo " disables moving to node on fizzle/interference"
echo " defaults to ON"
echo ""
echo " ;familiar --refreshtimer=#"
echo " sets time to refresh 920 too in minutes"
echo " defaults to 15 mins"
Lich::Messaging.msg("info", "This script will automatically refresh your familiar once you are under the defined refresh time remaining (#{UserVars.familiar[:refresh_timer]} minutes).")
Lich::Messaging.msg("info", "Start script using #{$lich_char}#{Script.current.name}")
Lich::Messaging.msg("info", "")
Lich::Messaging.msg("info", "Optional arguments:")
Lich::Messaging.msg("info", " #{$lich_char}#{Script.current.name} --allowmove=off")
Lich::Messaging.msg("info", " disables moving to node on fizzle/interference")
Lich::Messaging.msg("info", " defaults to YES, currently set to #{UserVars.familiar[:allow_move] ? 'YES' : 'NO'}")
Lich::Messaging.msg("info", "")
Lich::Messaging.msg("info", " #{$lich_char}#{Script.current.name} --refreshtimer=#")
Lich::Messaging.msg("info", " sets time to refresh 920 too in minutes")
Lich::Messaging.msg("info", " defaults to 15 mins, currently set to #{UserVars.familiar[:refresh_timer]} mins")
Lich::Messaging.msg("info", "")
Lich::Messaging.msg("warn", "This script requires that you know spell 920 - Call Familiar, which you do not.") unless Spell[920].known?
exit
end

unless Spell[920].known?
Lich::Messaging.msg("error", "You do not know spell 920 - Call Familiar.")
Lich::Messaging.msg("error", "Please learn the spell before running this script.")
exit
end

Expand All @@ -84,21 +97,21 @@ loop {
cast_result = Spell[920].cast
if cast_result =~ /fizzle|interfere/
if !UserVars.familiar[:allow_move]
echo "ALERT ALERT ALERT"
echo "ALERT ALERT ALERT"
echo ""
echo "You failed to cast 920 here"
echo "Pausing ;familiar"
echo ""
echo "Unpause to move away to closest node to refresh 920"
echo ""
echo "ALERT ALERT ALERT"
echo "ALERT ALERT ALERT"
Lich::Messaging.msg("info", "ALERT ALERT ALERT")
Lich::Messaging.msg("info", "ALERT ALERT ALERT")
Lich::Messaging.msg("info", "")
Lich::Messaging.msg("info", "You failed to cast 920 here")
Lich::Messaging.msg("info", "Pausing ;familiar")
Lich::Messaging.msg("info", "")
Lich::Messaging.msg("info", "Unpause to move away to closest node to refresh 920")
Lich::Messaging.msg("info", "")
Lich::Messaging.msg("info", "ALERT ALERT ALERT")
Lich::Messaging.msg("info", "ALERT ALERT ALERT")
pause_script
end
current_room = Room.current.id
echo "Moving to a node to re-fresh familiar in 10 seconds"
echo "Please ;k familiar before 10 seconds if you wish to stay"
Lich::Messaging.msg("info", "Moving to a node to re-fresh familiar in 10 seconds")
Lich::Messaging.msg("info", "Please ;k familiar before 10 seconds if you wish to stay")
sleep 10
Script.run("go2", "node")
waitrt?
Expand Down