Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Free User
    Join Date
    Nov 2014
    Posts
    12
    Reputation
    10
    Rep Power
    0

    Advanced loot counter

    Hi there!

    I am in need of a script that counts the loot. I know the MMH will count the loot if I have looting enabled. I don't use the looting built inside the bot when I hunt manually. It takes longer time for the bot to open the body than it does for me and sometimes it opens a body when I don't want it to open. I use a hotkey that will pick up the loot when I have opened the body. So do someone have a lootcounter where I don't need to have looting enabled? I have searched kinda much and tried to figure something out. Found a script that counted everything in a bp, but it counts wrong, horribly wrong. I guess people who teamhunts (me for example) would like something that counts the loot even if you don't loot yourself.

    I would appriciate any help I can get very much. Thanks in advance!

  2. #2
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    I'll do it.

  3. #3
    Free User
    Join Date
    Nov 2014
    Posts
    12
    Reputation
    10
    Rep Power
    0
    Would be lovely! <3

  4. #4
    Free User
    Join Date
    Nov 2014
    Posts
    12
    Reputation
    10
    Rep Power
    0
    Anyone? Please!

  5. #5
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    I've already started it but couldn't finish the script as exam's month started :/

    Basically, i'l get every "Loot of" message and parse it, saving the loot into an array. Then, i'll convert it into a HUD


    Code:
    auto(100)
    
    local LootCounter = {}
    
    function string:split( inSplitPattern, outResults )
       if not outResults then
          outResults = { }
       end
       local theStart = 1
       local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
       while theSplitStart do
          table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) )
          theStart = theSplitEnd + 1
          theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
       end
       table.insert( outResults, string.sub( self, theStart ) )
       return outResults
    end
    
    function trimString( s )
       return string.match( s,"^()%s*$") and "" or string.match(s,"^%s*(.*%S)" )
    end
    
    foreach newmessage m do
    	if m.type == MSG_INFO then
    		local HasLoot = m.content:match(REGEX_LOOT)
    		
    		if (HasLoot ~= 'nothing') then
    		
    			--remove 'loot of' text
    			local RemoveFirstPart = m.content:split(':')
    			local ItemList = RemoveFirstPart[2]:split(', ')
    		
    			for i, item in ipairs(ItemList) do
    				--remove empty spaces
    				item = trimString(item)
    				
    				if LootCounter[item] == nil then
    					LootCounter[item] = 0
    				end
    				
    				if (item:match('coin')) then
    					--to do
    				else
    					LootCounter[item] = LootCounter[item] + 1
    				end
    										
    			end
    			
    		end
    		
    	end
    end

  6. #6
    Free User
    Join Date
    Nov 2014
    Posts
    12
    Reputation
    10
    Rep Power
    0
    Oh, great thank you! No stress. Good luck with your exams!

  7. #7
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,437
    Reputation
    309
    Rep Power
    28
    Just replace .amountlooted with .lootmessage on original MMH.
    There should be only 2 occurrences, at lines 136 and 137.
    Last edited by Raphael; 09-11-2015 at 05:06 PM.

  8. #8
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    Quote Originally Posted by Raphael View Post
    Just replace .amountused with .lootmessage on original MMH.
    There should be only 2 occurrences, at line 191 and 192 or 193 and 194.
    This is amazing!!!!

  9. #9
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    Quote Originally Posted by Raphael View Post
    Just replace .amountused with .lootmessage on original MMH.
    There should be only 2 occurrences, at line 191 and 192 or 193 and 194.
    @Raphael, does lootingitem class inherits from itemdata?

  10. #10
    Free User
    Join Date
    Nov 2014
    Posts
    12
    Reputation
    10
    Rep Power
    0
    When I replace this error comes up for me:

    17:09:19 error in HUD script MonitorMyHunting:
    ["if (MMH.SHOW_ALL_SUPPLIES or ItemE..."]:MonitorMyHunting:193 attempt to index local 'ItemEntry' with an unknown property

    I am too stupid to understand what I am doing wrong. It's probably something simple. Mind helping me?

 

 

Posting Permissions

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