Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Sbounty: Bug Fix List

  1. #1

    Default Sbounty: Bug Fix List

    After spending several hours trying to troubleshoot an Sbounty error, I figured I should share the fix in case others are struggling with it. Feel free to add any other changes you've made to Sbounty to fix any outstanding bugs.


    ISSUE: Failing to recognize and complete heirloom LOOT bounties in OTF.

    FIX:
    Code:
        'task_heirloom'  => 'unfortunate citizen lost after being attacked by (?:a|an) (?<creature>.*?) (?:in|on|around|near|by) (?<area>.*?)(| near (?<real>.*?))\.*LOOT',

    ISSUE: Failing to turn in an heirloom after completing a bounty.

    FIX:
    Code:
        'success_heirloom' => '^You have located (?:a|an|some) (.*) and should bring it back .*\.$'

    Disclaimer: I'm not a code guru, don't blame me if it doesn't work! If there are any code gurus, feel free to jump in and correct me!
    Last edited by SashaFierce; 07-11-2017 at 10:18 PM.

  2. Default

    Quote Originally Posted by SashaFierce View Post
    After spending several hours trying to troubleshoot an Sbounty error, I figured I should share the fix in case others are struggling with it. Feel free to add any other changes you've made to Sbounty to fix any outstanding bugs.


    ISSUE: Failing to recognize and complete heirloom LOOT bounties in OTF.

    FIX:
    Code:
        'task_heirloom'  => 'unfortunate citizen lost after being attacked by (?:a|an) (?<creature>.*?) (?:in|on|around|near|by) (?<area>.*?)(| near (?<real>.*?))\.*LOOT',

    ISSUE: Failing to turn in an heirloom after completing a bounty.

    FIX:
    Code:
        'success_heirloom' => '^You have located (?:a|an) (.*) and should bring it back .*\.$'

    Disclaimer: I'm not a code guru, don't blame me if it doesn't work! If there are any code gurus, feel free to jump in and correct me!
    Thanks Sasha!

  3. #3

    Default

    I will apply these and upload a new version. Thanks.
    It must be hard to type with ghostcrawlers penis lodged in your ass. - g++

  4. #4

    Default

    Quote Originally Posted by SpiffyJr View Post
    I will apply these and upload a new version. Thanks.
    I feel like I should provide the following in case there are unseen issues with my code.

    Code:
    Jarivyth says, "Hmm, I've got a task here from the town of Ta'Illistim.  It appears they need your help in tracking down some kind of lost heirloom.  Go report to one of the guardsmen just inside the Ta'Illistim City Gate to find out more.  Be sure to ASK about BOUNTIES."
    
    Jarivyth adds, "I encourage you to work with other adventurers who are also around your level of experience.  If you wish for them to formally aid you in this task, simply bring them before me and ASK me to ADD them to your task."
    
    The guardsman says, "Ah, so you're from the Adventurer's Guild?  Yes, we do have a task for you.  One of our citizens was attacked by an Ithzir champion in Old Ta'Faendryl.  She barely escaped with her life.  Unfortunately, in her haste to escape, she dropped a family heirloom of great sentimental value to her.  She has put up a reward for its safe return.  The heirloom is a silver and turquoise rod and you'll be able to identify it by the initials JD engraved upon it.  Hunt down the creature that attacked her, retrieve the heirloom, and report back to me."
    
    You have been tasked to recover a silver and turquoise rod that an unfortunate citizen lost after being attacked by an Ithzir champion in Old Ta'Faendryl.  The heirloom can be identified by the initials JD engraved upon it.  Hunt down the creature and LOOT the item from its corpse.
    I was also informed there's an issue with the SEARCH string, but I don't usually do those bounties, so I haven't tested.
    Last edited by SashaFierce; 07-08-2017 at 10:03 PM.

  5. #5

    Default

    I could find a regex that would work if I had search strings from every variation in the game but that's not exactly readily available... hence the original bug.
    It must be hard to type with ghostcrawlers penis lodged in your ass. - g++

  6. Default

    Thanks for starting this thread. I had applied similar fixes to my OTF search and heirloom checks. I believe task_found still needs to be updated in the current version, which has:

    Code:
    'task_found'     => 'You have located the heirloom',
    I use, since the actual message does not say "heirloom", but instead the actual heirloom's description.:

    Code:
    'task_found'     => 'You have located',
    In addition, task_forage needs to be updated to ignore non-hostile npcs (familiars, spirit servants, etc):

    Code:
    if GameObj.npcs.any? {|npc| npc.type =~ /aggressive npc/}
        if not song_of_peace and not GameObj.npcs.find_all { |npc| npc.status !~ /dead|gone/ }.nil?
            break
        end
    end
    Last edited by Zenith; 07-10-2017 at 12:53 PM.

  7. Default

    Quote Originally Posted by Zenith View Post
    Thanks for starting this thread. I had applied similar fixes to my OTF search and heirloom checks. I believe task_found still needs to be updated in the current version, which has:

    Code:
    'task_found'     => 'You have located the heirloom',
    I use, since the actual message does not say "heirloom", but instead the actual heirloom's description.:

    Code:
    'task_found'     => 'You have located',
    In addition, task_forage needs to be updated to ignore non-hostile npcs (familiars, spirit servants, etc):

    Code:
    if GameObj.npcs.any? {|npc| npc.type =~ /aggressive npc/}
        if not song_of_peace and not GameObj.npcs.find_all { |npc| npc.status !~ /dead|gone/ }.nil?
            break
        end
    end
    I applied the fix for task_found but the script wanted to still expedite the bounty.

  8. Default

    Quote Originally Posted by OMGWTFBBQ View Post
    I applied the fix for task_found but the script wanted to still expedite the bounty.
    task_found wouldn't be responsible for that, as it is just the trigger after you're already on the bounty and completed it (found the item). If it's trying to expedite the bounty, it means didn't match on the checks before you even start a bounty. You'd need to post the message you're receiving for expediting and what it says when you type BOUNTY.

  9. #9

    Default

    I spent some time trying to understand the logic of the sbounty script and I think I found a few issues in the work flow. Here are my suggestions:

    Issue: Will not talk_to_npc after being assigned a bounty if you have just turned in a bounty and need to rest.

    Code:
    [sbounty]>ask guardsman about bounty
    The guardsman says, "Ah, so you have returned.  I take it you were successful?  Good.  The town of Ta'Illistim thanks you for your help.  I shall inform the Adventurer's Guild that you successfully completed your task.  You may pick up your reward there, Alastir."
    
    [sbounty]>urch guide bounty
    
    You flag down a nearby urchin and indicate your desired destination.
    The urchin nods to you and rapidly guides you through a series of back alleys, side streets, and little-used shortcuts until you reach your destination in mere seconds.
    
    [Ta'Illistim, Alearyl Hall]
    You notice Guild Taskmaster Jarivyth.
    Obvious exits: east, west, out
    
    [sbounty]>ask Jarivyth about bounty
    
    Jarivyth says, "All done with that assignment?  Good job, Alastir!"
    
    [You have earned 925 bounty points, 1000 experience points, and 9250 silver.]
    [sbounty: -- finished task (925 points, 1000 exp, 9250 silver)]
    
    Jarivyth nods to you and says, "Looking for something to do, Alastir?  I've got just the thing for you.  If you want to know more, simply ask me about BOUNTIES."
    
    [sbounty]>ask #17328060 for bounty
    
    Jarivyth says, "Hmm, I've got a task here from the town of Ta'Illistim.  It appears they have a creature problem they'd like you to solve.  Go report to one of the guardsmen just inside the Ta'Illistim City Gate to find out more.  Be sure to ASK about BOUNTIES."
    [ Next Bounty: +0:15:00, 0:15:00 remaining. ]
    
    Jarivyth adds, "I encourage you to work with other adventurers who are also around your level of experience.  If you wish for them to formally aid you in this task, simply bring them before me and ASK me to ADD them to your task."
    
    Goes to REST here instead of finishing the task assignment.
    FIX: Testing in progress

    Code:
    while true
        talk_to_npc.call
    
        if can_do_bounty.call and not CharSettings[:should_rest_wounded].call
            if is_bounty.call 'task_search'
                task_search.call
            elsif is_bounty.call 'task_forage' and Time.now.to_i >= last_forage_attempt + last_forage_delay
                task_forage.call
            end
        elsif Spell['Next Bounty'].active? and (expedite_left and not is_bounty.call 'none' and not can_do_bounty.call and CharSettings[:enable_expedite])
            expedite_bounty.call
            next
        end
    
        if is_bounty.call 'task_escort' and GameObj.npcs.find { |npc| npc.name =~ /child/ }
            task_escort.call 'advguard'
        elsif is_bounty.call 'task_fail'
            can_do_bounty_cache = nil
        elsif is_bounty.call 'success_heirloom'
            success_heirloom.call
        end
    
        exit if dead?
    
        if can_turn_in.call
            turn_in.call
            resting = false
        else
            if not can_do_bounty.call and not Spell['Next Bounty'].active?
                remove_bounty.call
                get_bounty.call
    			#ADDED-HACK-BEGIN
    			if is_bounty.call ['help_creature', 'help_resident', 'help_heirloom', 'help_gemdealer', 'help_herbalist', 'help_furrier']
    				talk_to_npc.call
    			end
    			#ADDED-HACK-END

    Issue: Sometimes you will forage an extra herb for your herb task, when you turn them in, you'll be left with an extra herb in your hand and it doesn't put it away.

    FIX:
    Code:
    talk_to_herbalist = proc {
    
        go2_nearest.call([ 3824, 1851, 10396, 640, 5722, 2406, 11002, 9505 ]) unless Room.current.id == 640
    
        if Room.current.id == 10396
            npc = 'maraene'
        else
            npc = GameObj.npcs.find { |t| t.name =~ /brother Barnstel|scarred Agarnil kris|healer|herbalist|merchant Kelph|famed baker Leaftoe|Akrash|old Mistress Lomara/i }
        end
    
        if is_bounty.call 'help_herbalist'
            res = dothistimeout "ask #{npc} about bounty", 5, /Yes, I do have a task for you/
            if res =~ /I've recently received an order for ([0-9]+) (.*?)\./
                print.call "received bounty from herbalist [#{$1} #{$2}]"
            end
        elsif bounty? =~ /#{bounty_patterns['task_forage']}/
            herb_name = $1.gsub(/s?$/,'')
            herbs     = lootsack.contents.find_all { |item| item.name =~ /#{herb_name}/ }
    
            if herbs.empty?
                error.call 'no herbs to turn in, why are you here?'
            end
    
            prev_item = nil
            if GameObj.right_hand
                prev_item = GameObj.right_hand
    
                fput 'store right' if checkright
                fput 'stow right' if checkright
            end
    
            herbs.each { |herb|
                fput "get ##{herb.id} from ##{lootsack.id}"
                result = dothistimeout "give ##{herb.id} to #{npc}", 3, /This looks perfect|That looks like it has been partially used up/
    
                if result !~ /perfect/
                    fput "drop ##{herb.id}"
    	    #ADDED-HERBALIST-START
    	    elsif result =~ /You've collected all the samples I asked for/
    		fput "stow all"
    	    #ADDED-HERBALIST-END
                end
            }
    
            if prev_item
                fput "get ##{prev_item.id}"
            end
        else
            error.call 'why are you at the herbalist?'
        end
    }
    Last edited by SashaFierce; 07-11-2017 at 02:39 PM.

  10. #10

    Default

    Issue: The task_bandit routine likes to "jump around" because when you "go2 $1 location" the rnums are in sequential order but not contiguous order.

    Fix: Unsure of a fix at the moment.

    Issue: task_bandit does not call your hunt_prepare or start_hunting_scripts prior to seeking out bandits to destroy.

    Fix:

    Code:
    task_bandit = proc {
        if bounty? !~ /#{bounty_patterns['task_bandit']}/
            error.call('you are not on a bandits bounty')
        end
    
        print.call('culling bandits')
    
        my_ambush = false
        ambush_room_count = XMLData.room_count
    
        location = $1.strip.downcase
        rooms = Room.list.find_all { |r| r.location =~ /#{location}/i }.collect { |r| r.id }
    	
        if CharSettings[:enable_bandit_script] and not Script.exists?(CharSettings[:bandit_script])
            error.call('bandit script is enabled could not be found')
        end
    
    	#ADDED-BEGIN
    	hunt_prepare.call
    	start_hunting_scripts.call
    	#ADDED-END
    	
        while not CharSettings[:should_rest_wounded].call and is_bounty.call('task_bandit')
            rooms.each { |room|
                waitrt?
                waitcastrt?
    
                print.call 'moving to room ' + room.to_s
    
                fput 'stance defensive' unless checkstance == 'defensive'
    
                go2.call(room)
    
                print.call('waiting for attack')
    
                start = Time.now.to_i
                while true
                    if Time.now.to_i - start > 3
                        break
                    end
    
                    if GameObj.npcs.find { |npc| npc.type =~ /bandit/ }
                        break
                    end
    
                    sleep 0.25
                end
    
                while not CharSettings[:should_rest_wounded].call()
                    npcs = GameObj.npcs.to_a.find_all { |npc| npc.type =~ /bandit/ and npc.status !~ /dead/ }
                    dead = GameObj.npcs.to_a.find_all { |npc| npc.type =~ /bandit/ and npc.status =~ /dead/ }
    
                    if npcs.empty?
                        break
                    elsif CharSettings[:enable_bandit_script]
                        waitrt?
                        waitcastrt?
    
                        if not dead.empty?
                            run_loot_script.call()
                        else
                            start_script(CharSettings[:bandit_script], npcs.collect { |n| n.id }, h={:quiet=>true})
                            wait_while { running?(CharSettings[:bandit_script]) }
                        end
                    else
                        print.call('kill them all then unpause me!')
                        script.pause
                    end
    
                    sleep 0.25
                end
    
                break if CharSettings[:should_rest_wounded].call or not is_bounty.call('task_bandit')
            }
    
            rooms.reverse!
    
            sleep 0.1
        end
    
        kill_hunting_scripts.call
    }

Similar Threads

  1. Some sbounty help please?
    By sellies in forum The Lich Project
    Replies: 2
    Last Post: 04-25-2020, 04:34 PM
  2. Sbounty
    By n0551n3n0m1n3 in forum The Lich Project
    Replies: 2
    Last Post: 12-20-2017, 03:02 PM
  3. Sbounty Fork
    By SashaFierce in forum The Lich Project
    Replies: 4
    Last Post: 09-20-2017, 04:53 PM
  4. sbounty error, any help please?
    By Nazagor in forum Scripting Discussion
    Replies: 0
    Last Post: 10-30-2016, 07:01 PM
  5. sbounty and bandits
    By elcidcannon in forum The Lich Project
    Replies: 3
    Last Post: 09-15-2015, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •