RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

XAS skill bar equipment request [XP]

Started by Wrinkle, December 02, 2014, 12:27:09 AM

0 Members and 1 Guest are viewing this topic.

Wrinkle

I really like this script and would be useful for one of my projects. However the skill bar lets you equip a weapon, one armor, a skill, and an item. I was wondering if I could have it just dedicated to the actor's equipment alone; a weapon, a shield, body armor, head piece, and then accessory. I only really need 4 of those so you can take out the accessory if you want, and I don't need the function where you click on the boxes and it uses the weapon or skill. I just want the windows to pop up so you can change the equipment. If someone could do that, or explain to me how to fix it, it would be appreciated. I will try figuring it out in the meantime.

Here's the script for the equipment windows and skill bar
[spoiler]#===========================================================================#
#  #*****************#              Equipable Items Window                  #
#  #*** By Falcao ***#            - Window selectable aliased               #
#  #*****************#                                                      #
#         RMXP                                                              #
# makerpalace.onlinegoo.com                                                 #
#===========================================================================#

# Windows font name
Equipable_Window_Font = "Georgia"

class Window_Selectable < Window_Base
  alias falcao_rect_update update_cursor_rect
  def update_cursor_rect
    falcao_rect_update
    if $scene.is_a?(Scene_Map)
      cursor_width = self.width / @column_max - 10
      x = @index % @column_max * (cursor_width)
      y = @index / @column_max * 32 - self.oy
      self.cursor_rect.set(x - 6, y, cursor_width , 32)
    end
  end
end

#--------------------------------------------------------------------------
# * Weapon equip window
#--------------------------------------------------------------------------
class Window_Weapon_Select < Window_Selectable
  attr_reader   :data
  def initialize
    super(16, 224,  240, 160)
    @column_max = 2
    self.z = 900
    self.opacity = 150
    refresh
    self.index = 0
  end
 
  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
 
    actor = $game_party.actors[0]
    weapon_set = $data_classes[actor.class_id].weapon_set
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
        @data.push($data_weapons[i])
      end
    end
   
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    item = @data[index]
    number = $game_party.weapon_number(item.id)
    x = 4 + index % 2 * (80 + 32)
    y = index / 2 * 32
    self.contents.font.size = 14
    self.contents.font.name = Equipable_Window_Font
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x - 5, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)#opacity
    self.contents.draw_text(x + 22, y, 212, 32, item.name, 0)
    self.contents.font.size = 12
    self.contents.font.color = Color.new(0,0,0,255) #black
    self.contents.draw_text(x, y + 12, 24, 32, number.to_s)
    self.contents.font.color = Color.new(250,255,255,255) #white
    self.contents.draw_text(x - 1, y + 11, 24, 32, number.to_s)
  end
end

#--------------------------------------------------------------------------
# * Equip Shield
#--------------------------------------------------------------------------
class Window_Shield_Select < Window_Selectable
  attr_reader   :data
  def initialize
    super(48, 224,  240, 160)
    self.z = 900
    @column_max = 2
    self.opacity = 150
    refresh
    self.index = 0
  end
 
  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
   
    actor = $game_party.actors[0]
    armor_set = $data_classes[actor.class_id].armor_set
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0 and armor_set.include?(i)
        if $data_armors[i].kind == 0
          @data.push($data_armors[i])
        end
      end
    end
   
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    item = @data[index]
    number = $game_party.armor_number(item.id)
    x = 4 + index % 2 * (80 + 32)
    y = index / 2 * 32
    self.contents.font.size = 14
    self.contents.font.name = Equipable_Window_Font
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x - 5, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
    self.contents.draw_text(x + 22, y, 212, 32, item.name, 0)
    self.contents.font.size = 12
    self.contents.font.color = Color.new(0,0,0,255) #black
    self.contents.draw_text(x, y + 12, 24, 32, number.to_s)
    self.contents.font.color = Color.new(250,255,255,255) #white
    self.contents.draw_text(x - 1, y + 11, 24, 32, number.to_s)
  end
end

#--------------------------------------------------------------------------
# * Skills equip window
#--------------------------------------------------------------------------
class Window_Skill_Select < Window_Selectable
  attr_reader   :data
  def initialize
    super(80, 224,  240, 160)
    self.z = 900
    @column_max = 2
    self.opacity = 150
    refresh
    self.index = 0
  end
 
  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    actor = $game_party.actors[0]
    for i in 0...actor.skills.size
      skill = $data_skills[actor.skills[i]]
      if skill != nil
        @data.push(skill)
      end
    end
   
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    skill = @data[index]
    actor = $game_party.actors[0]
    if actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (80 + 32)
    y = index / 2 * 32
    self.contents.font.size = 14
    self.contents.font.name = Equipable_Window_Font
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x - 5, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 22, y, 204, 32, skill.name, 0)
  end
end

#--------------------------------------------------------------------------
# * Items equip window
#--------------------------------------------------------------------------
class Window_Item_Select < Window_Selectable
  attr_reader   :data
  def initialize
    super(112, 224,  240, 160)
    self.z = 900
    @column_max = 2
    self.opacity = 150
    refresh
    self.index = 0
  end
 
  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
   
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
   
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    if $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (80 + 32)
    y = index / 2 * 32
    self.contents.font.size = 14
    self.contents.font.name = Equipable_Window_Font
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x - 5, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 22, y, 212, 32, item.name, 0)
    self.contents.font.size = 12
    self.contents.font.color = Color.new(0,0,0,255) #black
    self.contents.draw_text(x, y + 12, 24, 32, number.to_s)
    self.contents.font.color = Color.new(250,255,255,255) #white
    self.contents.draw_text(x - 1, y + 11, 24, 32, number.to_s)
  end
end


class Item_Descript < Window_Base
  def initialize
    super(0, 0, 240, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 900
    self.opacity = 200
  end

  def set_text(wx, wy, text = "", name = "")
    self.contents.clear
     self.contents.font.bold = false
    self.contents.font.size = 14
    self.x = wx
    self.y = wy
    self.contents.draw_text(0, 10, self.width + 60, 32, text)
    self.contents.font.size = 16
    self.contents.font.bold = true
    self.contents.draw_text(-20, -10 , self.width, 32, name, 1)
  end
end


#------------------------------------------------------------------------------
class Scene_Map
  alias falitem_window_main main
  def main
    falitem_window_main
    dispose_window_tools
  end
 
  def create_weapon_window
    @fweapon_window = Window_Weapon_Select.new
    @ihelp_window = Item_Descript.new
  end
 
  def create_shield_window
    @fshield_window = Window_Shield_Select.new
    @ihelp_window = Item_Descript.new
  end
 
  def create_skill_window
    @fskill_window = Window_Skill_Select.new
    @ihelp_window = Item_Descript.new
  end
 
  def create_item_window
    @fitem_window = Window_Item_Select.new
    @ihelp_window = Item_Descript.new
  end
 
  def dispose_window_tools
    @fitem_window.dispose if not @fitem_window.nil?
    @fitem_window = nil
    @ihelp_window.dispose if not @ihelp_window.nil?
    @ihelp_window = nil
    @fweapon_window.dispose if not @fweapon_window.nil?
    @fweapon_window = nil
    @fshield_window.dispose if not @fshield_window.nil?
    @fshield_window = nil
    @fskill_window.dispose if not @fskill_window.nil?
    @fskill_window = nil
    $game_system.menu_disabled = $game_map.check_itemmenu_active[1]
    $game_map.check_itemmenu_active[0] = false
  end
 
  alias falitem_window_update update
  def update
    falitem_window_update
    update_items_system
  end
 
  def update_items_system
    if Mouse.trigger?(0)
      return if $game_switches[MOG_ACTIVE_HUD::DISABLE_HUD_SWITCH]
      case $game_map.falgrid_cube
     
      #weapon
      when 5
        dispose_window_tools
        create_weapon_window
        @fweapon_window.refresh
        $game_map.check_itemmenu_active[0] = true
        $game_system.se_play($data_system.decision_se)
     
        #shield
      when 6
        dispose_window_tools
        create_shield_window
        @fshield_window.refresh
        $game_map.check_itemmenu_active[0] = true
        $game_system.se_play($data_system.decision_se)
       
        # skills
      when 7
        dispose_window_tools
        create_skill_window
        @fskill_window.refresh
        $game_map.check_itemmenu_active[0] = true
        $game_system.se_play($data_system.decision_se)
         
        #item
      when 8
        dispose_window_tools
        create_item_window
        @fitem_window.refresh
        $game_map.check_itemmenu_active[0] = true
        $game_system.se_play($data_system.decision_se)
      end
    end

    # item
    if not @fitem_window.nil?
      @fitem_window.update
      if @fitem != nil
        if @fitem_window.data.size > 8 and @fitem_window.data.size < 15
          @fitem_window.height = 256
          @fitem_window.y = 128
          @ihelp_window.set_text(112, 65, @fitem.description, "Items")
        elsif @fitem_window.data.size > 14
          @fitem_window.height = 320
          @fitem_window.y = 65
          @ihelp_window.set_text(112, 2, @fitem.description, "Items")
        else
          @ihelp_window.set_text(112, 161, @fitem.description, "Items")
        end
      else
        @ihelp_window.set_text(112, 161,"", "Items")
      end
      @fitem = @fitem_window.item
      fupdate_item
   
    #weapon
    elsif not @fweapon_window.nil?
      @fweapon_window.update
      if @fweapon != nil
        if @fweapon_window.data.size > 8 and @fweapon_window.data.size < 15
          @fweapon_window.height = 256
          @fweapon_window.y = 128
          @ihelp_window.set_text(16, 65, @fweapon.description, "Weapons")
        elsif @fweapon_window.data.size > 14
          @fweapon_window.height = 320
          @fweapon_window.y = 65
          @ihelp_window.set_text(16, 2, @fweapon.description, "Weapons")
        else
          @ihelp_window.set_text(16, 161, @fweapon.description, "Weapons")
        end
      else
        @ihelp_window.set_text(16, 161,"", "Weapons")
      end
      @fweapon = @fweapon_window.item
      fupdate_item
   
    #shield
    elsif not @fshield_window.nil?
      @fshield_window.update
      if @shieldcc != nil
        if @fshield_window.data.size > 8 and @fshield_window.data.size < 15
          @fshield_window.height = 256
          @fshield_window.y = 128
          @ihelp_window.set_text(48, 65, @shieldcc.description, "Armor")
        elsif @fshield_window.data.size > 14
          @fshield_window.height = 320
          @fshield_window.y = 65
          @ihelp_window.set_text(48, 2, @shieldcc.description, "Armor")
        else
          @ihelp_window.set_text(48, 161, @shieldcc.description, "Armor")
        end
      else
        @ihelp_window.set_text(48, 161,"", "Armor")
      end
      @shieldcc = @fshield_window.item
      fupdate_item
     
    #skill
    elsif not @fskill_window.nil?
      @fskill_window.update
      if @fskills != nil
        if @fskill_window.data.size > 8 and @fskill_window.data.size < 15
          @fskill_window.height = 256
          @fskill_window.y = 128
          @ihelp_window.set_text(80, 65, @fskills.description, "Skills")
        elsif @fskill_window.data.size > 14
          @fskill_window.height = 320
          @fskill_window.y = 65
          @ihelp_window.set_text(80, 2, @fskills.description, "Skills")
        else
          @ihelp_window.set_text(80, 161, @fskills.description, "Skills")
        end
      else
        @ihelp_window.set_text(80, 161,"", "Skills")
      end
      @fskills = @fskill_window.item
      fupdate_item
    end
  end
 
  def fupdate_item
    if $game_switches[MOG_ACTIVE_HUD::DISABLE_HUD_SWITCH]
      dispose_window_tools
      return
    end
   
    $game_system.menu_disabled = true
    # If input press B clear everything
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      dispose_window_tools
    end
   
    return if $game_map.over_the_cube?
    if Mouse.trigger?(0)
     
      # Equip Items
      if not @fitem_window.nil?
         if @fitem == nil
           $game_system.se_play($data_system.cancel_se)
           dispose_window_tools
           return
         end
       
        item_id = @fitem.id
        item_tool_id = XAS::XASITEM_ID[@fitem.id]
        if item_tool_id != nil
          $game_system.se_play($data_system.equip_se) 
          $game_system.xas_item_id = @fitem.id
        end
        dispose_window_tools
        return
       
      # Equip Weapons
      elsif not @fweapon_window.nil?
        if @fweapon == nil
          $game_system.se_play($data_system.cancel_se)
          dispose_window_tools
          return
        end
        actor = $game_party.actors[0]
        actor.equip(0, @fweapon.id)
        $game_system.se_play($data_system.equip_se) 
        dispose_window_tools
       
      # Equip secundary weapon xas shield
      elsif not @fshield_window.nil?
        if @shieldcc == nil
          $game_system.se_play($data_system.cancel_se)
          dispose_window_tools
          return
        end
        actor = $game_party.actors[0]
        actor.equip(1, @shieldcc.id)
        $game_system.se_play($data_system.equip_se) 
        dispose_window_tools
       
      # Equip skills
      elsif not @fskill_window.nil?
        if @fskills == nil
          $game_system.se_play($data_system.cancel_se)
          dispose_window_tools
          return
        end
        $game_system.se_play($data_system.equip_se)
        dispose_window_tools
      end
    end
  end
end

class Interpreter
  alias fal_command_135 command_135
  def command_135
    $game_map.check_itemmenu_active[1] =  (@parameters[0] == 0)
    fal_command_135
  end
end
[/spoiler]
[spoiler]#===========================================================================#
#  #*****************#              Skill Bar System                        #
#  #*** By Falcao ***#              - Game_Map aliased                      #
#  #*****************#              - Spriteset_Map aliased                 #
#         RMXP                                                              #
# makerpalace.onlinegoo.com                                                 #
#===========================================================================#

# better no touch this variables unless you know what you are doing
FalSbar_x = 8
FalSbar_y = 12

class Game_Map
  attr_accessor :falgrid_cube
  attr_accessor :check_itemmenu_active
  alias falgridentries_initialize initialize
  def initialize
    @falgrid_cube = 0
    @check_itemmenu_active = [false, false]
    falgridentries_initialize
  end
 
  alias falscreen_update update
  def update
    falscreen_update
    update_button_positions
  end
 
  def update_button_positions
    if $game_switches[MOG_ACTIVE_HUD::DISABLE_HUD_SWITCH]
      @falgrid_cube = 0
      return
    end
   
    unless $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing 
     
      # create button skills position squared 32 x 32
      mx = Mouse.pos[0] / 32
      my = Mouse.pos[1] / 32
      sx = FalSbar_x
      sy = FalSbar_y
       
       # four buttons upper line
      if  mx == sx and my == sy
        @falgrid_cube = 1
       
      elsif mx - 1 == sx  and my == sy
        @falgrid_cube = 2
     
      elsif mx - 2 == sx  and my == sy
        @falgrid_cube = 3
       
      elsif mx - 3 == sx  and my == sy
        @falgrid_cube = 4
     
        # four buttons lower line
      elsif mx  == sx  and my - 1 == sy
        @falgrid_cube = 5
       
      elsif mx - 1  == sx  and my - 1 == sy
        @falgrid_cube = 6
       
      elsif mx - 2  == sx  and my - 1 == sy
        @falgrid_cube = 7
       
      elsif mx - 3  == sx  and my - 1 == sy
        @falgrid_cube = 8
     
        #Overdrive button
      elsif mx - 5 == sx  and my == sy
        @falgrid_cube = 9
   
      else
        @falgrid_cube = 0
      end
    end
  end
 
  def over_the_cube?
    return true if @falgrid_cube != 0
    return false
  end
end

#-------------------------------------------------------------------------

class Grid_Buttons_Sprites
  def initialize
    @pos_x = FalSbar_x
    @pos_y = FalSbar_y
    create_grid_sprite
    create_pointer_sprite if $game_map.over_the_cube?
    @number = 0
    @counter = 0
    update
  end
 
  def create_grid_sprite
    if @grid.nil?
      @grid = Sprite.new
      @grid.bitmap = RPG::Cache.picture("Skill Bar")
      @grid.z = 1000
      @grid.x = @pos_x * 32
      @grid.y = @pos_y * 32
    end
  end
 
  def create_pointer_sprite
    if @grid_pointer.nil?
      @grid_pointer = Sprite.new
      @grid_pointer.bitmap = Bitmap.new(640, 480)
      @grid_pointer.z = 6000
    end
  end
 
  def create_overdrive_sprite
    if @over_icon.nil?
      @over_icon = Sprite.new
      @over_icon.bitmap = RPG::Cache.icon("MAG_Doom")
      @over_icon.z = 1000
      px, py = @pos_x + 5, @pos_y
      @over_icon.x = px * 32
      @over_icon.y = py * 32
      @text = Sprite.new
      @text.bitmap = Bitmap.new(150,34)
      @text.x, @text.y = @over_icon.x - 4, @over_icon.y - 22
      @text.z = 1000
      @text.bitmap.font.size = 12
      @text.bitmap.font.name = "Georgia"
      @text.bitmap.draw_hemming_text(0, 0, 100, 32, "Special")
    end
  end
 
  def dispose
    if not @grid.nil?
      @grid.dispose
      @grid.bitmap.dispose
      @grid = nil
      dispose_pointer
      dispose_overdrive_icon
    end
  end
 
  def dispose_pointer
    if not @grid_pointer.nil?
      @grid_pointer.dispose
      @grid_pointer.bitmap.dispose
      @grid_pointer = nil
    end
  end
 
  def dispose_overdrive_icon
    if not @over_icon.nil?
      @over_icon.dispose
      @over_icon.bitmap.dispose
      @over_icon = nil
      @text.dispose
      @text.bitmap.dispose
      @text = nil
    end
  end
 
  def update
    update_blink
    update_visible
  end
 
  def update_blink
   
    $game_map.over_the_cube? ? create_pointer_sprite : dispose_pointer
     
    case $game_map.falgrid_cube
    when 1
      blink_bar(@pos_x, @pos_y)
    when 2
      blink_bar(@pos_x + 1, @pos_y)
    when 3
      blink_bar(@pos_x + 2, @pos_y)
    when 4
      blink_bar(@pos_x + 3, @pos_y)
    when 5
      blink_bar(@pos_x, @pos_y + 1, true)
    when 6
      blink_bar(@pos_x + 1, @pos_y + 1, true)
    when 7
      blink_bar(@pos_x + 2, @pos_y + 1, true)
    when 8
      blink_bar(@pos_x + 3, @pos_y + 1, true)
     
      #overdrive
    when 9
     # blink_bar(@pos_x + 5, @pos_y)
    end
  end
 
  def update_visible
    unless $game_switches[MOG_ACTIVE_HUD::DISABLE_HUD_SWITCH]
      create_grid_sprite
      create_pointer_sprite if $game_map.over_the_cube?
    else
      dispose
    end
  end
 
  def blink_bar(px, py, triangle=false)
    @grid_pointer.bitmap.clear
    px = px * 32 + 3
    py = py * 32 + 3
    @number += 5
   
    @number = 5 if @number == 90
    color = Color.new(255, 255, 255, @number)
   
    # Triangle pointer
    if triangle
      @grid_pointer.bitmap.fill_rect(px, py, 24, 8, color)
      @grid_pointer.bitmap.fill_rect(px + 1, py + 8,       22, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 2, py + 9,       20, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 3, py + 10,      18, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 4, py + 11,      16, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 5, py + 12,      14, 1, color) 
      @grid_pointer.bitmap.fill_rect(px + 6, py + 13,      12, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 7, py + 14,      10, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 8, py + 15,      8, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 9, py + 16,      6, 1, color)
      @grid_pointer.bitmap.fill_rect(px + 10, py + 17,      4, 1, color)
      return
   
      # Rectangle
    #elsif rectangle
     # self.bitmap.fill_rect(px, py, 26, 18, color)
      #return
    end
 
    # square
    @grid_pointer.bitmap.fill_rect(px, py, 24, 24, color)
  end
end


#------------------------------------------------------------------------------
class Spriteset_Map
  alias falcaosp_initialize initialize
  def initialize
    falcaosp_initialize
    @fal_grid_buttons = Grid_Buttons_Sprites.new
  end
 
  alias falcaosp_dispose dispose
  def dispose
    @fal_grid_buttons.dispose
    falcaosp_dispose
  end
 
  alias falcaosp_update update
  def update
    falcaosp_update
    @fal_grid_buttons.update if @fal_grid_buttons != nil
  end
end
[/spoiler]
If at first you don't succeed, keep on sucking until you do succeed