Advertisement
jbrocky

Untitled

Jun 14th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 9.16 KB | None | 0 0
  1. =begin
  2.   Documentation: https://elanthipedia.play.net/Lich_script_repository#theurgy
  3. =end
  4.  
  5. custom_require.call(%w[common common-items common-money common-travel drinfomon spellmonitor equipmanager])
  6.  
  7. class DankTheurgy
  8.   include DRC
  9.   include DRCI
  10.   include DRCM
  11.   include DRCT
  12.  
  13.   ######################## GET/PUT ########################
  14.  
  15.   def put_in_container(item)
  16.     bput "put #{item} in my #{@theurgy_supply_container}", 'You put', 'What were you referring to'
  17.   end
  18.  
  19.   def get_from_container(item)
  20.     bput "get #{item} from my #{@theurgy_supply_container}", 'You get', 'I could not find', 'What were you referring to'
  21.   end
  22.  
  23.   ######################## COMMUNES ########################
  24.  
  25.   def comm_eluned
  26.     fput "stow #{GameObj.right_hand.noun}" if GameObj.right_hand.name != 'Empty'
  27.     fput "stow #{GameObj.left_hand.noun}" if GameObj.left_hand.name != 'Empty'
  28.  
  29.     walk_to('2801') if @hometown.eql? 'Shard'
  30.     walk_to('764') if @hometown.eql? 'Crossing'
  31.     forage? 'dirt'
  32.  
  33.     get_from_container(@water_holder)
  34.     bput('commune eluned', 'completed this commune too recently', 'You grind some dirt in your fist')
  35.     put_in_container(@water_holder)
  36.     fput('drop dirt') if [left_hand, right_hand].include?('dirt')
  37.   end
  38.  
  39.   def comm_tamsine
  40.     if inside?('holy water', @water_holder)
  41.       pause 1
  42.       waitrt?
  43.       get_from_container(@water_holder)
  44.       fput "sprinkle #{@water_holder} on #{checkname}"
  45.       bput('commune tamsine', 'commune too recently', 'You feel warmth spread throughout your body')
  46.       put_in_container(@water_holder)
  47.     else
  48.       Flags.delete('theurgy-tamsine')
  49.       nil
  50.     end
  51.   end
  52.  
  53.   def comm_truff
  54.     fput "stow #{GameObj.right_hand.noun}" if GameObj.right_hand.name != 'Empty'
  55.     fput "stow #{GameObj.left_hand.noun}" if GameObj.left_hand.name != 'Empty'
  56.     bput('prep gg', 'You begin')
  57.     bput('cast drink', 'You raise')
  58.  
  59.     case bput('commune truffenyi', 'ommune too recently', 'The power of Truffenyi has answered your prayer')
  60.     when 'The power of Truffenyi has answered your prayer'
  61.       fput 'drop orb'
  62.     end
  63.  
  64.     fput "drop #{GameObj.right_hand.noun}" if GameObj.right_hand.name != 'Empty'
  65.   end
  66.  
  67.   ######################## DEVOTION RITUALS ########################
  68.  
  69.   def clean_altar
  70.     return unless @hometown.eql? 'Shard'
  71.     return unless inside?('holy water', @water_holder)
  72.     get_from_container(@water_holder)
  73.     fput 'clean altar with holy water'
  74.     waitfor 'You finish your job'
  75.     put_in_container(@water_holder)
  76.     waitrt?
  77.   end
  78.  
  79.   def buy_flint
  80.     return unless withdraw_exact_amount?('1 gold', @settings)
  81.  
  82.     if @hometown.eql?('Crossing')
  83.       walk_to('8265')
  84.       5.times do
  85.         fput('buy flint')
  86.         fput('offer 143 kro')
  87.         fput('offer 143 kro')
  88.         put_in_container('flint')
  89.       end
  90.     elsif @hometown.eql?('Shard')
  91.       walk_to('9747')
  92.       5.times do
  93.         fput('buy flint')
  94.         fput('offer 36 dok')
  95.         fput('offer 36 dok')
  96.         put_in_container('flint')
  97.       end
  98.     end
  99.   end
  100.  
  101.   def buy_incense
  102.     return unless withdraw_exact_amount?('5 silver', @settings)
  103.  
  104.     if @hometown.eql?('Crossing')
  105.       walk_to('19073')
  106.       5.times do
  107.         fput('buy incense')
  108.         fput('offer 62 kro')
  109.         fput('offer 62 kro')
  110.         put_in_container('incense')
  111.       end
  112.     elsif @hometown.eql?('Shard')
  113.       walk_to('8179')
  114.       fput('go divy arch')
  115.       pause 1
  116.       fput('go door')
  117.       pause 1
  118.       5.times do
  119.         fput('buy incense')
  120.         fput('offer 45 dok')
  121.         fput('offer 45 dok')
  122.         put_in_container('incense')
  123.       end
  124.       fput('out')
  125.       pause 1
  126.       fput('go arch')
  127.       pause 1
  128.     end
  129.   end
  130.  
  131.   def tithe
  132.     return unless @tithe
  133.     return unless withdraw_exact_amount?('5 silver', @settings)
  134.  
  135.     if @hometown.eql?'Crossing'
  136.       walk_to(741)
  137.       bput('put 5 silver kro in almsbox', 'You drop', 'But you do not')
  138.     elsif @hometown.eql?'Shard'
  139.       walk_to(8179)
  140.       fput('go smar arch')
  141.       bput('put 5 silver dok in almsbox', 'You drop', 'But you do not')
  142.       fput('go arch')
  143.     end
  144.   end
  145.  
  146.   def pray
  147.     waitrt?
  148.     if @favor_god
  149.       bput("pray #{@favor_god}", @favor_god, 'Lady of healing', 'reward of hard effort', 'sign with your hand', 'god of the Void', 'bane of accursed', 'blessing be upon your love', 'honorable and true', 'glory shine on us', 'fire across the lands', 'madness and pain', 'floods strike down', 'Lady of supreme beauty')
  150.     else
  151.       bput('pray meraud', 'meraud')
  152.     end
  153.     waitrt?
  154.   end
  155.  
  156.   def find_seed
  157.     return unless inside?('holy water', @water_holder)
  158.     walk_to '1032' if @hometown.eql?'Crossing'
  159.     walk_to '2789' if @hometown.eql?'Shard'
  160.     exit unless DRRoom.npcs.empty? # Invasion check
  161.     while bput('gather seed', 'You find a tiny', 'This is not a good', 'You come up empty') == 'You come up empty'
  162.       waitrt?
  163.     end
  164.     waitrt?
  165.     plant_seed
  166.   end
  167.  
  168.   def plant_seed
  169.     walk_to '1031' if @hometown.eql?'Crossing'
  170.     walk_to '6462' if @hometown.eql?'Shard'
  171.     fput('plant seed')
  172.     get_from_container(@water_holder)
  173.     fput("sprinkle #{@water_holder} on room")
  174.     put_in_container(@water_holder)
  175.   end
  176.  
  177.   def pray_badge
  178.     case bput('remove badge', 'You take off', 'Remove what')
  179.     when 'You take off'
  180.       fput('pray badge')
  181.       pause 2
  182.       waitrt?
  183.       bput 'wear badge', 'You put on a', 'You are already'
  184.     when 'Remove what'
  185.       case bput('get badge', 'You get', 'I could not find', 'What were you referring to')
  186.       when 'You get'
  187.         fput('pray badge')
  188.         pause 2
  189.         waitrt?
  190.         put_in_container('pilgrim badge')
  191.       end
  192.     end
  193.   end
  194.  
  195.   def dance
  196.     walk_to('5989') if @hometown.eql?('Crossing')
  197.     walk_to('8154') if @hometown.eql?('Shard')
  198.     until ['flawless performance to those on high', 'In your condition', 'Your dance reaches its conclusion'].include? bput('dance', 'flawless performance to those on high', 'Your dance reaches its conclusion', 'You begin to dance', 'Your actions grow', 'Your dance', 'but you falt', 'In your condition')
  199.       pause 1
  200.       waitrt?
  201.       fix_standing
  202.     end
  203.     waitrt?
  204.   end
  205.  
  206.   def reflectory
  207.     return unless @hometown.eql?('Crossing')
  208.     walk_to('5988')
  209.     fput('meditate')
  210.     waitrt?
  211.   end
  212.  
  213.   def recite_prayer
  214.     fput "recite Meraud, power the holy fires that unleash my righteous vengeance;Chadatru, guide my sword to swing in justice;Everild, give me the power to conquer my enemies;Truffenyi, let me not lose sight of compassion and mercy;Else, I will become like those I despise;Urrem'tier, receive into your fetid grasp these wicked souls;May the Tamsine's realms never know their evil ways again;May all the Immortals guide your faithful soldier #{checkname}."
  215.     pause 1
  216.     waitrt?
  217.   end
  218. ######################## FLAGS ########################
  219.  
  220.   Flags.add('theurgy-commune', 'fully prepared to seek assistance from the Immortals once again', 'You will not be able to open another divine conduit yet', 'You grind some dirt in your fist', 'You feel warmth spread throughout your body', 'The power of Truffenyi has answered your prayer', 'The thick smell of ozone fills your nostrils')
  221.  
  222.   def commune_check
  223.     if !Flags['theurgy-commune']
  224.       return true
  225.     elsif Flags['theurgy-commune'].include? 'fully prepared to seek assistance from the Immortals once again'
  226.       return true
  227.     end
  228.   end
  229.  
  230.   def wait_for_commune
  231.     entrance_time = Time.now
  232.     bput("play #{UserVars.song}", 'dirtiness may affect your performance', 'slightest hint of difficulty', 'You begin a', 'You struggle to begin', 'You\'re already playing a song', 'You effortlessly begin', 'You begin some', 'You cannot play', 'Play on what instrument', 'now isn\'t the best time to be playing', 'Perhaps you should find somewhere drier before trying to play')
  233.     while !commune_check
  234.       break if Time.now - entrance_time > 180
  235.       pause 10
  236.     end
  237.     bput('stop play', 'You stop playing your song', 'In the name of', "But you're not performing")
  238.   end
  239.  
  240.   ######################## MISC ########################
  241.  
  242.   def initialize
  243.     #return unless DRSkill.getxp('Theurgy') < 2
  244.     @settings = get_settings
  245.     @theurgy_supply_container = @settings.theurgy_supply_container
  246.     @water_holder = @settings.water_holder
  247.     @hometown = @settings.hometown
  248.     @favor_god = @settings.favor_god
  249.     @safe_room = @settings.safe_room
  250.     @tithe = @settings.tithe
  251.     UserVars.song = @song_list.first.first unless UserVars.song
  252.  
  253.     ######################## SCRIPT ########################
  254.  
  255.     walk_to '741' if @hometown.eql?('Crossing')
  256.     walk_to '2499' if @hometown.eql?('Shard')
  257.     buy_incense unless inside?('incense', @theurgy_supply_container)
  258.     buy_flint unless inside?('flint', @theurgy_supply_container)
  259.     pray
  260.  
  261.     things_to_do = %i[comm_eluned comm_truff find_seed wait_for_commune comm_tamsine pray_badge dance clean_altar recite_prayer reflectory tithe pray]
  262.     #things_to_do = %i[comm_eluned comm_truff find_seed pray_badge dance clean_altar recite_prayer reflectory tithe pray]
  263.     things_to_do.each { |thing| send(thing) }
  264.   end
  265. end
  266.  
  267. DankTheurgy.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement