Jump to content
  • 0
Sign in to follow this  
Tasho

Anti exp button

Question

Hi, I have a problem I think is from the client-side.

Problem: When I click on the AntiExpRing and storage buttons it pops-up a this: 

xfpz5h.png

1orma9.jpg

 

Normally it dosen't suppous to pop-up nothing, just a text in the bottom-right that says whether or not the botton is activ or not.

I'll pot sa quest and the client part maybe someone knows a solutin.

 

Server-side:

 


 

  • quest clientquest_test begin
        state start begin
            when login begin
                cmdchat("loadquest1 "..q.getcurrentquestindex())
            end
            when button or info begin
                local get = clientquest_test.getinput("getinput")
    if get == "12" then -- Lager Button
    game.open_safebox()
    end
    
    
    if get == "13" then -- AntiExp Button
    if pc.getqf('reset2') == 0 then
    pc.setqf('reset2',1)
    pc.setqf('reset',pc.get_exp())
    loop_timer("antiexp", 1)
    syschat("Ati blocat experienta.")
    else
    pc.setqf('reset2',0)
    cleartimer("antiexp")
    syschat("Ati deblocat experienta.")
    end
    end
            end
    
    
    when login with pc.getqf('reset2') > 0 begin
    loop_timer("antiexp", 1)
    syschat("Experienta este blocata.")
    end
    
    
    when antiexp.timer begin
                local oxp = pc.getqf('reset')
                if pc.get_exp() > oxp then
                    pc.give_exp2(-(pc.get_exp()-oxp))
                end
            end
    
    
    function getinput(par)
                cmdchat("getinputbegin")
                local ret = input(cmdchat(par))
                cmdchat("getinputend")
                return ret
            end
        end
    end  

Client: 

constinfo.py


LoadQuest1 = 0
INPUT_IGNORE = 0
SendInfo = "0

game.py

 


def __QuestClient_1(self, qid):
constInfo.LoadQuest1 = qid


def __Inputget1(self):
constInfo.INPUT_IGNORE = 1 


def __Inputget2(self):
constInfo.INPUT_IGNORE = 0


def __Inputget3(self):
info = constInfo.SendInfo
net.SendQuestInputStringPacket(str(info))

# QUEST KOMMUNIKATION
"loadquest1" : self.__QuestClient_1,
"getinputbegin" : self.__Inputget1,
"getinputend" : self.__Inputget2,
"getinput" : self.__Inputget3,

uiinventory.py

 


def ClickIshopButton(self):
eq = constInfo.LoadQuest1
#chat.AppendChat(chat.CHAT_TYPE_INFO, eq)
constInfo.SendInfo = "12"
event.QuestButtonClick(int(eq))


def __AntiExpRing(self):
eq = constInfo.LoadQuest1
constInfo.SendInfo = "13"
event.QuestButtonClick(int(eq))

# MallButton
if self.mallButton:
self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
self.ishopButton.SetEvent(ui.__mem_func__(self.ClickIshopButton))


self.AntiEXPButton.SetEvent(ui.__mem_func__(self.__AntiExpRing))

self.AntiEXPButton = self.GetChild2("AntiExpButton")
self.ishopButton = self.GetChild2("IshopButton")
self.ishopButton = None

 

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0

Add to the when button or info begin

setskin(NOWINDOW)

I don't test it, but maybe it run.

Share this post


Link to post
  • 0

game.py

Search the following def:

	def OpenQuestWindow(self, skin, idx):
		self.interface.OpenQuestWindow(skin, idx)
And replace it with this:

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		self.interface.OpenQuestWindow(skin, idx)
  • Love 2

Share this post


Link to post
  • 0

You can use q.no_send() to tell the server that he shouild not send scripts about this quest to the server the button will still appear but nothing more and it will still acceppt input.

Has less bugs than the public stuff everyone is using

Share this post


Link to post
  • 0

game.py

Search the following def:

	def OpenQuestWindow(self, skin, idx):
		self.interface.OpenQuestWindow(skin, idx)
And replace it with this:

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		self.interface.OpenQuestWindow(skin, idx)

it worked. thanks

  • Love 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.