Page 2 of 10 FirstFirst 1234 ... LastLast
Results 11 to 20 of 95

Thread: Bigshot Updates

  1. #11

    Default

    Quote Originally Posted by Buckwheet View Post
    That is the best list I know of as well.
    If someone wants to put all of the animals into a regex list. dog|cat|hawk|etc|etc

    http://drfuturepast.com/GSIV/GECP/

    I also need logs of them in the room with ;e echo Gameobj.npcs. Also ;e echo Gameobj.loot.

    There is also the problem of what to do with YOUR current animal. How are they spawned? Are they random? Is there an activespell when the animal is on? I'm thinking it should be easy to do but there will be edge cases where 2 rangers with 2 animals could poach each other. I could capture the summoning lines but if 2 rangers summon 2 of the same animals...

    Anyways, let me see some logs of animals being summoned/swapped as well.
    Last edited by Haldrik; 12-03-2015 at 04:46 PM.

  2. #12

    Default

    Quote Originally Posted by m444w View Post
    I haven't played GS in like 4 months at least at this point, but I wrote a gem for the vast majority of this stuff (detecting aggressive NPCs vs mundane for instance) that people may find useful.

    The github repo is here: https://github.com/ondreian/Olib
    and docs are here: http://www.rubydoc.info/gems/Olib

    Everything except Containers (which is global as well) exists under the Olib global namespace, to prevent unintended naming collisions with Lich definitions.

    Hopefully someone finds it useful, and while I am not playing, I will accept PR/issues and keep maintaining it if people find it to be a worthwhile endeavor.

    It is a gem, so it can be required and therefore is not on the ;repo
    https://github.com/ondreian/Olib/blo...er/group.rb#L6

    whoa man. that's deep.
    Mithrilschlong, 2015-03-10 to slightly later on 2015-03-10. You will not be forgotten!
    usable Meteor Swarm, late 2020-12-30 to early 2020-12-31. You will also not be forgotten!

  3. #13

    Default

    I fucking hate bigshot. I've got everything working and it does double commands even after I break the attack loop like 5-6 defs deep. WHYYYYY.

  4. #14

    Default

    Completely new updates. Rewrote targeting (again) and wander (again.) Cleaned up random double commands (hopefully.) Currently has no group functionality for poaching.

    http://pastebin.com/BnrpXxN3

    Here are the changes.

    Code:
        def no_players()
            return false if GameObj.loot.find { |obj| obj.noun == 'disk' and obj.name !~ /#{Char.name}/}
            return false if checkpcs or $ambusher_here
            return true
        end
    
    def do_hunt()
            spam() if UserVars.op['spam']
            
            start_watch()
            message('Bigshot hunting')
    
            # loop
            target = nil
            just_arrived = true
            last_attack = 0
            $ambusher_here = false
        
        start_exec_script( <<-eos
            while(line = get);
                break unless running?('bigshot');
                $ambusher_here = true if line =~ /^\w+ leaps from hiding to attack/;
            end;
            eos
            )
    
    
        while true
            while( (target = find_target(target, just_arrived)) && !should_rest? && no_players == true)
                echo target if $bigshot_debug
                if( (Time.now.to_i - last_attack > 15) || just_arrived )
                    @followers.add_event(:ATTACK)
                    last_attack = Time.now.to_i
                end
                attack(target)
                just_arrived = false
                loot() if $ambusher_here == false
            end
            
            echo "Exiting attack loop" if $bigshot_debug
            gather_ammo()
    
            if(should_rest?)
                break
            else
                prepare_for_movement()
                target = bs_wander()
    			sleep 1
                just_arrived = true
            end
            
        end
    
            unspam()
        end
    Code:
     def attack(target)
            commands = find_routine(target)
            echo commands if $bigshot_debug
    
            commands.each do |i|
                break unless valid_target?(target)
                break if wounded? || $bigshot_should_rest
                break if $ambusher_here
                stand()
                cast_signs()
                
                cmd( i, target )
            end
            echo commands.size if $bigshot_debug
            #sleep 1 if commands.size == 0
        end
    Code:
    def cmd( command, npc = nil, stance_dance = true )
            command = command.dup
    
            if( command.class.to_s == 'Array' )
                stance_dance = false if command.any? { |j| j =~ /stance/ }
                command.each do |i|
                    echo i if $bigshot_debug
                    cmd( i, npc, stance_dance )
                end
                return
            end
    
            # check mana/stamina
            if( command =~ /(.*)\(([s|m])(\d+)\)$/ )
                if( $2 == 's' )
                    return if !checkstamina($3.to_i)
                elsif( $2 == 'm' )
                    return if !checkmana($3.to_i)
                end
                command = $1
            end
            
            if( command =~ /force\s+(.*)\s+(?:till|until)\s+(\d+)/ )            
                cmd_force( $1, $2.to_i, npc )
                return
            end
            
            # sub id
            command.gsub!( /target/, "##{npc.id}" ) if !npc.nil?
            
            # waitrt/waitcastrt
            unless( command =~ /^nudgeweapons?/ )
                waitrt?
                waitcastrt? if command =~ /^\d+|incant/
            end
    
            # change_stance
            stand()
            unless( command =~ /^(?:\d+|wait|sleep|wand|berserk|script|hide|nudgeweapon)/ )
                change_stance(@HUNTING_STANCE) if stance_dance
            end
    
            return if npc && !valid_target?(npc)
    
            if( command =~ /^(\d+)(.*)$/ )
                cmd_spell( $1.to_i, $2.strip, npc )
    		elsif( command =~ /^throw/i )
    			cmd_throw( npc )
    		elsif( command =~ /^k?weed/i )
    			cmd_weed( command, npc )
            elsif( command =~ /^wand\s+(.*)/i )
                cmd_wand(npc)
            elsif( command =~ /^hide/i )
                cmd_hide()
            elsif( command =~ /^mstrike/i )
                cmd_mstrike( command, npc )
            elsif( command =~ /^fire/i )
                cmd_ranged(npc)
            elsif( command =~ /^berserk/i )
                cmd_berserk()
            elsif( command =~ /^script\s+(.*?)(\s|$)(.*)/i )
                cmd_run_script( $1, $3 )
            elsif( command =~ /^sleep\s+(\d+)/i )
                cmd_sleep( $1, npc )
            elsif( command =~ /^stance\s+(.*)/i )
                change_stance($1)
            elsif( command =~ /^wait\s+(\d+)/i )
                wait_for_swing( $1.to_i, npc )
            elsif( command =~ /^nudgeweapons?\s*/i )
                cmd_nudge_weapons
            else
                return if command =~ /1030/ && checkmana < 10
                return if $ambusher_here
                echo "inside cmd: #{command}" if $bigshot_debug
                bs_put command
            end
        end
    Code:
    def bs_wander()
    		wander_last_room = nil
    		
            wander = proc {
                room = Room.current
                next_room_options = room.wayto.keys - @HUNTING_BOUNDARIES
                if next_room_options.length > 1
                    next_room_options.delete_if { |option| option == wander_last_room }
                end
                next_room = next_room_options[rand(next_room_options.length)]
                way = room.wayto[next_room]
                if way.class == String 
    				sleep 0.3
                    move(way)
                else
                    way.call
                end
    			cast_signs(true)
                wander_last_room = room.id.to_s
            }
            
            while true  # wander, check for players
                echo "no_players: #{no_players}" if $bigshot_debug
                npcs = GameObj.npcs
                npcs.delete_if { |npc| (npc.status =~ /dead|gone/) }
                sort_npcs.each { |i| return i if valid_target?( i, true ) and no_players == true and GameObj.npcs.size > 0 } 
                return if should_rest?
                wander.call
                sleep 0.1
                $ambusher_here = false    
            end
        end
    Last edited by Haldrik; 12-05-2015 at 07:06 PM.

  5. #15

    Default

    Cleaned and added new code to OP.
    Last edited by Haldrik; 12-05-2015 at 07:19 PM.

  6. #16

    Default

    Thanks for posting this and looking to update bigshot. I like bigshot but also felt it could be cleaned up quite a bit. I thought that someone had fixed BS so it wouldn't poach but it still seemed to. I've been downloading and trying out your version and it seems to be working as far as I can see so far.

  7. #17

    Default

    Quote Originally Posted by Soulance View Post
    Thanks for posting this and looking to update bigshot. I like bigshot but also felt it could be cleaned up quite a bit. I thought that someone had fixed BS so it wouldn't poach but it still seemed to. I've been downloading and trying out your version and it seems to be working as far as I can see so far.
    Cool. Let me know if you see any bugs. Also if it works with people ambushing let me know. I only tested that part through ;exec variable changes.

    Oh, if anyone has other ambushing messages I can add those in. Like snipe messaging, etc.

  8. #18

    Default

    Quote Originally Posted by Haldrik View Post
    If someone wants to put all of the animals into a regex list. dog|cat|hawk|etc|etc

    http://drfuturepast.com/GSIV/GECP/

    I also need logs of them in the room with ;e echo Gameobj.npcs. Also ;e echo Gameobj.loot.

    There is also the problem of what to do with YOUR current animal. How are they spawned? Are they random? Is there an activespell when the animal is on? I'm thinking it should be easy to do but there will be edge cases where 2 rangers with 2 animals could poach each other. I could capture the summoning lines but if 2 rangers summon 2 of the same animals...

    Anyways, let me see some logs of animals being summoned/swapped as well.
    I suppose the script could check for any NPCs in the room that aren't aggressive and if it finds any it would assume it's a companion or familiar or something. The only problem I can think of is sometimes town guards are in hunting grounds so the script could ignore any NPCs with the name "guard."

    Of course as you said this causes a problem with one's own familiar/companion/whatever, so you could have the script check for when one of these is summoned and the script would then ignore that particular NPC. The only problem then would be as you said if someone else happens to have exactly the same type of familiar/companion/whatever as you do, in that case fuck'em. They can write their own script!

  9. #19

    Default

    Quote Originally Posted by Tgo01 View Post
    I suppose the script could check for any NPCs in the room that aren't aggressive and if it finds any it would assume it's a companion or familiar or something. The only problem I can think of is sometimes town guards are in hunting grounds so the script could ignore any NPCs with the name "guard."
    That would be a lot easier. And yeah. TV has a lot of those guards too. But I think this solution is probably the easiest.

    Quote Originally Posted by Tgo01 View Post
    Of course as you said this causes a problem with one's own familiar/companion/whatever, so you could have the script check for when one of these is summoned and the script would then ignore that particular NPC. The only problem then would be as you said if someone else happens to have exactly the same type of familiar/companion/whatever as you do, in that case fuck'em. They can write their own script!
    Hahaha. Well said.

  10. #20

    Default

    Why not allow a spot to put in your pets description?
    Chris

Similar Threads

  1. Bigshot Lag
    By Tyros in forum The Lich Project
    Replies: 11
    Last Post: 05-16-2020, 01:32 AM
  2. Bigshot and 312
    By Erous in forum The Lich Project
    Replies: 2
    Last Post: 05-01-2020, 08:54 PM
  3. Run Bigshot Once
    By Loumeer in forum The Lich Project
    Replies: 7
    Last Post: 04-30-2017, 07:28 PM
  4. Bigshot tail without bigshot head?
    By Erez in forum The Lich Project
    Replies: 2
    Last Post: 11-26-2016, 06:15 PM
  5. need some bigshot help, also hi
    By Luftstreitkräfte in forum Gemstone: Shattered
    Replies: 4
    Last Post: 04-12-2014, 01:34 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
  •