1. #1

    Gentlemens Club Gambler

    Hi, I was wondering if anyone had a 6.0 update for GCG?


    The original can be found here:
    http://gcguild.net/pages/gcgambler/

    Basic point of the mod is just put the amount you wish to roll for, let people hit 1, last call for rolls, everyone rolls out of say 10k. Lowest roll is from A and he rolled 1234, and highest roll is from B and they rolled 6789. Player A owes player B 5555 gold.

    This is what it normally looks like, is this but the issue I am getting is that I cannot hit escape or leave the gold amount box.
    Last edited by nectarine; 2014-10-17 at 10:57 PM.

  2. #2
    Without doing further testing, it looks like lines 649-652 of GCGambler.lua are the problem:

    Code:
    function GCGambler_EditBox_OnLoad()
    	GCGambler_EditBox:SetNumeric("true");
    	GCGambler_EditBox:SetAutoFocus("false");
    end

    Change those lines to:

    Code:
    function GCGambler_EditBox_OnLoad()
    	GCGambler_EditBox:SetNumeric(true);
    	GCGambler_EditBox:SetAutoFocus(false);
    end

    Seems to work, for that bug anyway. Doesn't look like it actually picks up rolls in /p.

    - - - Updated - - -

    The remaining issues are because the addon stores names from chat, which include -ServerName, while it parses the roll emote (which does not have server names).

    Because of that, it seems to work okay if we just change it to strip server information when people are added to the group.

    Code:
    function GCGambler_OnEvent(self, event, ...)
    
    	-- LOADS ALL DATA FOR INITIALIZATION OF ADDON --
    	arg1,arg2 = ...;
    	local strippedName = tostring(arg2):match("^(%a+)%-") or tostring(arg2)
    	
    	if (event == "PLAYER_ENTERING_WORLD") then
    		GCGambler_EditBox:SetJustifyH("CENTER");
    
    		if(not GCGambler) then
    			GCGambler = {
    				["active"] = 1, 
    				["chat"] = false, 
    				["strings"] = { },
    				["lowtie"] = { },
    				["hightie"] = { },
    				["bans"] = { }
    			}
    		end
    		if(not GCGambler["lastroll"]) then GCGambler["lastroll"] = 100; end
    		if(not GCGambler["stats"]) then GCGambler["stats"] = { }; end
    		if(not GCGambler["joinstats"]) then GCGambler["joinstats"] = { }; end
    		if(not GCGambler["chat"]) then GCGambler["chat"] = false; end
    		if(not GCGambler["bans"]) then GCGambler["bans"] = { }; end
    
    		GCGambler_EditBox:SetText(""..GCGambler["lastroll"]);
    
    		if(GCGambler["chat"] == false) then
    			GCGambler_CHAT_Button:SetText("(Party)");
    			chatmethod = "PARTY";
    		else
    			GCGambler_CHAT_Button:SetText("(Raid)");
    			chatmethod = "RAID";
    		end
    
    		if(GCGambler["active"] == 1) then
    			GCGambler_Frame:Show();
    		else
    			GCGambler_Frame:Hide();
    		end
    	end
    
    	-- IF IT'S A RAID MESSAGE... --
    	if ((event == "CHAT_MSG_RAID_LEADER" or event == "CHAT_MSG_RAID") and AcceptOnes=="true" and GCGambler["chat"] == true) then
    		
    		-- ADDS USER TO THE ROLL POOL - CHECK TO MAKE SURE THEY ARE NOT BANNED --
    		if (arg1 == "1") then
    			if(GCGambler_ChkBan(strippedName) == 0) then
    				GCGambler_Add(strippedName);
    				if (not GCGambler_LASTCALL_Button:IsEnabled() and totalrolls == 1) then
    					GCGambler_LASTCALL_Button:Enable();
    				end
    				if totalrolls == 2 then
    					GCGambler_AcceptOnes_Button:Disable();
    					GCGambler_AcceptOnes_Button:SetText("Open Entry");
    				end
    			else
    				SendChatMessage("Unable to accept entry. No pay, no play. Got it?", chatmethod);
    			end
    
    		elseif(arg1 == "-1") then
    			GCGambler_Remove(strippedName);
    			if (GCGambler_LASTCALL_Button:IsEnabled() and totalrolls == 0) then
    				GCGambler_LASTCALL_Button:Disable();
    			end
    			if totalrolls == 1 then
    				GCGambler_AcceptOnes_Button:Enable();
    				GCGambler_AcceptOnes_Button:SetText("Open Entry");
    			end
    		end
    	end
    
    	if ((event == "CHAT_MSG_PARTY_LEADER" or event == "CHAT_MSG_PARTY")and AcceptOnes=="true" and GCGambler["chat"] == false) then
    
    		-- ADDS USER TO THE ROLL POOL - CHECK TO MAKE SURE THEY ARE NOT BANNED --
    		if (arg1 == "1") then
    			if(GCGambler_ChkBan(strippedName) == 0) then
    				GCGambler_Add(strippedName);
    				if (not GCGambler_LASTCALL_Button:IsEnabled() and totalrolls == 1) then
    					GCGambler_LASTCALL_Button:Enable();
    				end
    				if totalrolls == 2 then
    					GCGambler_AcceptOnes_Button:Disable();
    					GCGambler_AcceptOnes_Button:SetText("Open Entry");
    				end
    			else
    				SendChatMessage("Unable to accept entry. No pay, no play. Got it?", chatmethod);
    			end
    
    		elseif(arg1 == "-1") then
    			GCGambler_Remove(strippedName);
    			if (GCGambler_LASTCALL_Button:IsEnabled() and totalrolls == 0) then
    				GCGambler_LASTCALL_Button:Disable();
    			end
    			if totalrolls == 1 then
    				GCGambler_AcceptOnes_Button:Enable();
    				GCGambler_AcceptOnes_Button:SetText("Open Entry");
    			end
    		end
    	end
    
    	if (event == "CHAT_MSG_SYSTEM" and AcceptRolls=="true") then
    		local temp1 = tostring(arg1);
    		GCGambler_ParseRoll(temp1);		
    	end	
    end

    That code should replace the entire GCGambler_OnEvent() function, starting at line 72. After replacement, the function ends on line 177.
    Last edited by Hekili; 2014-10-18 at 12:16 AM.
    Author, Hekili, a priority helper addon.

  3. #3
    Awesome, thank you.
    Last edited by nectarine; 2014-10-18 at 04:02 AM.

  4. #4
    Hey, I tried to update the code, It works but for some reason when I enter it doesn't realise that I have rolled? but it works if I don't enter any ideas?

  5. #5
    Sorry to bring back such an old topic but better then reopen a new one.

    With the code from Hekili it works mostly, but the roles from players which names includes an accent or special letters (ß, æ, ú, etc.) don't get recognized. Any idea how to fix this?

  6. #6
    Try changing this line in GCGambler_OnEvent:
    Code:
    local strippedName = tostring(arg2):match("^(%a+)%-") or tostring(arg2)
    to:
    Code:
    local strippedName = tostring(arg2):match("^(.+)%-") or tostring(arg2)
    Last edited by Woogs; 2014-12-15 at 01:26 AM.

  7. #7
    Bloodsail Admiral Supakaiser's Avatar
    10+ Year Old Account
    Join Date
    May 2010
    Location
    Emerald Dream
    Posts
    1,008
    Updated the addon according the the previous posts:

    https://www.mediafire.com/?qjk4g1uhkuhl13d
    Tired of ElvUI and its various clones?

    Try one of these:

    Altz UI
    // RealUI // KaitUI // ls: UI

  8. #8
    It works quite well with the changes. But does anyone know how to prevent the automatic show up of the addon? Every time you face a loading screen you have to close it again.

  9. #9
    Bloodsail Admiral Supakaiser's Avatar
    10+ Year Old Account
    Join Date
    May 2010
    Location
    Emerald Dream
    Posts
    1,008
    Quote Originally Posted by varyak View Post
    It works quite well with the changes. But does anyone know how to prevent the automatic show up of the addon? Every time you face a loading screen you have to close it again.
    http://www.mmo-champion.com/threads/...9#post31248879

    Is an updated version with more features than this one but it has the same problem with wanting to be open 24/7
    Tired of ElvUI and its various clones?

    Try one of these:

    Altz UI
    // RealUI // KaitUI // ls: UI

Posting Permissions

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