Jump to content

Sistema Afk


Dynamic Things
 Share

Recommended Posts

Sistema AFK

separador.png

Descompactar o root.

Abrem o constinfo.py e colocam a seguinte linha (nas linhas inicias do ficheiro).

AFK = 0

Agora vão abrir o game.py e adicionam a seguinte linha (nas linhas iniciais do ficheiro).

import time

Agora vamos adicionar um botão para executar o nosso sistema.

Exemplo: Procuram pela seguinte linha:

onPressKeyDict[app.DIK_F4]    = lambda : self.__PressQuickSlot(7)

E vão adicionar a seguinte linha em baixo.

onPressKeyDict[app.DIK_F6]    = lambda : self.__afk()

Ter em atenção se não existe já outro processo a ser executado pelo mesmo botão.

Agora vamos nas ultimas linhas do ficheiro e adicionam o seguinte: (Atenção isso tudo ainda no ficheiro game.py)

# AFk System
   def    __afk(self):
       if constInfo.AFK == 0:
           constInfo.AFK = 1
           self.PopupMessage("AFK system on")
       elif constInfo.AFK == 1:
           constInfo.AFK = 0
           self.PopupMessage("AFK system off")
   # Afk, sfarsit

Agora vamos procurar por def OnRecvWhisper e abaixo acrescentamos:

def OnRecvWhisper(self, mode, name, line):
       global afk
       afk = time.strftime("%H:%M")
       if mode == chat.WHISPER_TYPE_GM:
           self.interface.RegisterGameMasterName(name)
       if line[-25:] == "Excuse,I'm currently AFK.":
               net.SendWhisperPacket(name, afk)
               chat.AppendWhisper(mode, name, line)
               self.interface.RecvWhisper(name)
               return
       if constInfo.AFK == 1 and line[-5:] != afk:
               net.SendWhisperPacket(name, "Sorry i'm AFK.")
               chat.AppendWhisper(mode, name, line)
               self.interface.RecvWhisper(name)
       else:
           chat.AppendWhisper(mode, name, line)
           self.interface.RecvWhisper(name)

Agora abrimos o intrologin.py e procuramos pelo seguinte:

def __OpenLoginBoard(self):

Será algo parecido com isso:

def __OpenLoginBoard(self):

	self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton))
	self.serverExitButton.SetText(localeInfo.UI_CLOSE) 

Agora adicionamos o seguinte:


	constInfo.AFK = 0

terá que ficar assim:

def __OpenLoginBoard(self):

	constInfo.AFK = 0
	self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton))
	self.serverExitButton.SetText(localeInfo.UI_CLOSE) 

Se fizeram tudo como está no tópico o vosso resultado final irá ser este:

FDEWjW3.pngAsOOF1S.png

Iq0WLuw.png

Cumprimentos Dynamic Things

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...