Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- ;mybounty
- by Luxelle
- GTK setup pulled from Bigshot & Dreavening. All credit goes to Azanoth, SpiffyJr, Tillmen Dreaven for this great code!
- MyBounty
- 18 Sept 2017 ~ 20 Sept 2017
- 2 August 2021 ~ temp fix after PSM 3 busted it. You are going to need to babysit your own BOOST BOUNTY
- Asks for a bounty at the Adventurer's Guild until you get the bounty/bounties you want. Meant for use with BOOST BOUNTY and especially handy for Lumnis Contest weeks.
- author: Luxelle
- game: Gemstone
- tags: bounty, gems, herbs, specific, lumnis, contest, boost bounty, bounty boost, exclude bounties, bounties, skins, limit
- version: 2.1 - cleaned up testing errors from 2.0 oops!
- Tested in: Ta'Illistim, Ta'Vaalor, Wehnimer's
- Notes: to keep the bounties you want you need to first use: ;mybounty setup
- Thanks: Mice, Selandriel, Atanamir, Ondrein, and Pukk
- and a big thanks to Pukk for adding the GUI Setup <3
- Usage: ;mybounty
- =end
- def message(message)
- if $fake_stormfront then puts("\034GSL\r\n") else puts("<pushBold\/>") end
- puts("" + message)
- if $fake_stormfront then puts("\034GSM\r\n") else puts("<popBold\/>") end
- end
- setup = proc{
- Gtk.queue {
- $MB_WINDOW = Gtk::Window.new
- $MB_WINDOW.title = "Mybounty Setup"
- $MB_WINDOW.set_border_width(10)
- $MB_BOX = Gtk::VBox.new(false)
- $MB_BOX.set_border_width(5)
- $MB_VERTICAL_BOX1 = Gtk::VBox.new(false, 0)
- $MB_WINDOW.add($MB_BOX)
- $MB_NOTEBOOK = Gtk::Notebook.new
- $MB_NOTEBOOK.set_show_border(true)
- $MB_BOX.add($MB_NOTEBOOK)
- $MB_NOTEBOOK.append_page($MB_VERTICAL_BOX1, Gtk::Label.new('Bounties'))
- $MB_ENTRY = Hash.new
- $MB_TABLE_SIZE = Hash.new
- }
- Gtk.queue {
- $MB_TABLE1 = Gtk::Table.new(6, 3, false)
- $MB_TABLE1.row_spacings=3
- $MB_TABLE1.column_spacings=3
- $MB_VERTICAL_BOX1.pack_start($MB_TABLE1, false, false, 0)
- }
- def self.add_label_entry(table, label, variable)
- size = $MB_TABLE_SIZE[table] || 0
- label = Gtk::Label.new(label)
- align = Gtk::Alignment.new 1, 0, 0, 0
- align.set_padding(4, 0, 3, 4)
- align.add(label)
- table.attach(align, 0, 1, size, size + 1)
- entry = Gtk::Entry.new
- entry.text = UserVars.mybounty[variable].to_s
- entry.set_width_request(157)
- table.attach(entry, 1, 2, size, size + 1)
- $MB_ENTRY[variable] = entry
- $MB_TABLE_SIZE[table] += 1
- end
- Gtk.queue {
- $MB_ENTRY = Hash.new
- add_label_entry($MB_TABLE1, "Gems:", 'gems_setup')
- add_label_entry($MB_TABLE1, "Forage:", 'forage_setup')
- add_label_entry($MB_TABLE1, "Furrier:", 'furrier_setup')
- add_label_entry($MB_TABLE1, "Rescue Child:", 'kidrescue_setup')
- add_label_entry($MB_TABLE1, "creature Problem:", 'creature_setup')
- add_label_entry($MB_TABLE1, "Bandits:", 'bandit_setup')
- add_label_entry($MB_TABLE1, "Escorts:", 'escort_setup')
- add_label_entry($MB_TABLE1, "Heirloom:", 'heirloom_setup')
- }
- Gtk.queue {
- $MB_WINDOW.signal_connect("delete_event") {
- $MB_SETUP_COMPLETED = true
- }
- }
- Gtk.queue {
- $MB_TOOLTIPS = Gtk::Tooltips.new
- $MB_TOOLTIPS.enable
- label = Gtk::Label.new
- label.set_markup("Leave blank if you don't want to do that bounty, otherwise enter <b>YES</b>")
- align = Gtk::Alignment.new(1, 0, 0, 0)
- align.set_padding(5, 0, 0, 25)
- align.add(label)
- $MB_TABLE1.attach(align, 1, 2, 9, 10)
- $MB_WINDOW.show_all
- }
- $MB_SETUP_COMPLETED = false
- until($MB_SETUP_COMPLETED)
- sleep 1
- end
- UserVars.mybounty ||= Hash.new
- $MB_ENTRY.keys.each { |key|
- if( $MB_ENTRY[key].class.to_s =~ /CheckButton/ )
- value = $MB_ENTRY[key].active?
- UserVars.mybounty[key] = $MB_ENTRY[key].active?
- else
- if(key == 'wounded_eval')
- UserVars.mybounty[key] = $MB_ENTRY[key].text
- else
- UserVars.mybounty[key] = $MB_ENTRY[key].text.strip.downcase
- end
- end
- }
- UserVars.save()
- Gtk.queue {
- $MB_WINDOW.destroy
- }
- }
- ################
- ## Help
- ################################################
- def usage
- respond ""
- respond "Start this script at the Adventurer's Guild Taskmaster and it will ask for bounties until you get the one/s you want."
- respond "Remember to use BOUNTY BOOST for the script to continue. ;mybounty will remove your current bounty, no matter what it is, but not use a boost or move you."
- respond ""
- respond "Set your desired bounty/bounties first with: ;mybounty setup"
- respond ""
- respond "Usage, at the Adventurer's Guild: ;mybounty"
- respond ""
- exit
- end
- if script.vars[1] == "setup"
- setup.call
- exit
- elsif script.vars[1] == "help"
- usage
- elsif script.vars[1] == "?"
- usage
- elsif script.vars[1] =~ /(.*)/
- message("Usage is:
- ;mybounty setup
- ;mybounty help
- ;mybounty ?")
- exit
- end
- unless Room.current.tags.include? 'advguild'
- echo "Wrong place, get thee to the advguild."
- exit
- end
- echo = false
- gems = false
- forage = false
- furrier = false
- kidrescue = false
- creature = false
- bandit = false
- escort = false
- heirloom = false
- if UserVars.mybounty["gems_setup"] =~ /yes/i
- gems = true
- message("Gems: Yes")
- setup = true
- else
- gems = false
- end
- if UserVars.mybounty["forage_setup"] =~ /yes/i
- forage = true
- message("Forage: Yes")
- setup = true
- else
- forage = false
- end
- if UserVars.mybounty["furrier_setup"] =~ /yes/i
- furrier = true
- message("Furrier: Yes")
- setup = true
- else
- furrier = false
- end
- if UserVars.mybounty["kidrescue_setup"] =~ /yes/i
- kidrescue = true
- message("Kidrescue: Yes")
- setup = true
- else
- kidrescue = false
- end
- if UserVars.mybounty["creature_setup"] =~ /yes/i
- creature = true
- message("Creature: Yes")
- setup = true
- else
- creature = false
- end
- if UserVars.mybounty["bandit_setup"] =~ /yes/i
- bandit = true
- message("Bandit: Yes")
- setup = true
- else
- bandit = false
- end
- if UserVars.mybounty["escort_setup"] =~ /yes/i
- escort = true
- message("Escort: Yes")
- setup = true
- else
- escort = false
- end
- if UserVars.mybounty["heirloom_setup"] =~ /yes/i
- heirloom = true
- message("Heirloom: Yes")
- setup = true
- else
- heirloom = false
- end
- if gems == false && forage == false && furrier == false && kidrescue == false && creature == false && bandit == false && escort == false && heirloom == false
- message("You have nothing setup! Exiting!")
- exit
- end
- ##############
- # HERE WE GO! Look for just the bounty/ties you want
- # Check for current bounty and remove it if it is found, make sure Boost is going
- ################################################
- if XMLData.bounty_task != "You are not currently assigned a task."
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- end
- # if XMLData.active_spells.count {|spell| spell[0] =~ /Bounty Boost/ } > 0
- # echo "Bounty Boost Active ... continuing..."
- # else
- # echo "Use a BOOST BOUNTY and call me back, kay?"
- # exit
- # end
- ##############
- # Get the right bounty here!
- ################################################
- if setup == true
- fput "ask taskmaster for bounty"
- while line = get
- if line =~ /bandit/ and bandit == true
- echo "Got Your Bandits Right here!"
- break
- elsif line =~ /bandit/ and bandit == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /creature problem/ and creature == true
- echo "Got Your Creatures Right here!"
- break
- elsif line =~ /creature problem/ and creature == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /urgently needs/ and kidrescue == true
- echo "Got your rescue right here!"
- break
- elsif line =~ /urgently needs/ and kidrescue == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /lost heirloom/ and heirloom == true
- echo "Got your heirloom right here!"
- break
- elsif line =~ /lost heirloom/ and heirloom == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /local herbalist|local healer|local alchemist/ and forage == true
- echo "Got your foraging task right here!"
- break
- elsif line =~ /local herbalist|local healer|local alchemist/ and forage == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /local furrier/ and furrier == true
- echo "Got your skinning task right here!"
- break
- elsif line =~ /local furrier/ and furrier == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /gem dealer/ and gems == true
- echo "Got your gem task right here!"
- break
- elsif line =~ /gem dealer/ and gems == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /protective escort/ and escort == true
- echo "Got your escort task right here!"
- break
- elsif line =~ /protective escort/ and escort == false
- echo "Refusing this bounty ..."
- sleep 0.2
- fput "ask taskmaster for remov"
- fput "ask taskmaster for remov"
- sleep 4
- fput "ask taskmaster for bounty"
- end
- if line =~ /annoyed and says/
- sleep 2
- fput "ask taskmaster for bounty"
- end
- end
- else
- exit
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement