Jump to content

[PROBLEM] Itemshop button - Teleport map 1


Recommended Posts

Hello! I have recently tried to change the itemshop button in the inventory so that when you press it, it teleports you to map 1. What I did is:

I changed this line in root, in uiinventory.py:  def ClickMallButton(self):

With:  def ClickMallButton(self):
      import event
      event.QuestButtonClick(69)

After which I created a quest with the name "cock", which is number 69 in quest_list, that's what that (69) is in the upper code. It contains the following:

quest cock begin
    state start begin
        when button or info begin
         local e = pc.get_empire()
            if e==1 then
         pc.warp(473900, 954600)
            elseif e==2 then
         pc.warp(63200, 166700)
            elseif e==3 then
         pc.warp(959600, 269700)
            end
         end
      end
   end

I activate the quest in PuTTY, i don't get any errors, i do /reload q in game, but when I press the itemshop button nothing happens. Can you please tell me how can I make it work?

Link to comment
Share on other sites

21 minutes ago, Exygo said:

In the quest you need to send the quest id on login to the client so the client knows which quest to use

I tried with import event, if you read that. I don't know how to rewrite it in a different way. Can you please help me?

I dont know how to make it so when I press the itemshop button it reads my quest.

Link to comment
Share on other sites

  • Active Member

when login begin
cmdchat("whatever_name"..q.getcurrentquestindex())
end

 

then client receives command whatever_name (game.py) and save first argument of whatever_name to constInfo.py and then you can do this:

event.QuestButtonClick(and here you put index not 69 you pervert)

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.