Colocando Comandos , Efeitos e Mensagens no Transformice 1.40
Spoiler:
1 ) Abra a source 1.40 com o IDLE e procure por elif Opcode2 == "\x04" ,abaixo de self.Room.sendAllUTF("\x19\x04", Values), ponha:
elif Opcode1 == "\x0E":
if Opcode2 == "\x0A":
# Testar o Mapa
xml = Values [0]
self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do editor
code = str(random.randint(0, 999)) # Gerar o código
self.Server.CreateMap(self.Name, code, xml) # Criar o mapa
self.sendDataUTF("\x0E" + "\x05", [code]) # Mostrar o codigo
self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do editor
self.GotoRoom("br-1") # Ir para a sala 1
elif Opcode2 == "\x1A":
# Sair do Editor
self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do Editor
self.GotoRoom("br-1") # Ir para sala 1
2 ) Agora procure por def GetPlayer(self, name) , abaixo de return 0 ponha:
def CreateMap(self, username, code, xml):
self.Database.execute("INSERT INTO !VMaps (!MCreator, !MXML, !MID, !MPermanent) VALUES (?,?,?,0);", [username, xml, code])
self.Database.commit()
return 0
3 ) Abaixo de return 0 ponha isso:
def changeMapCc (self, map_number):
if map_number.startswith ("@"):
isCustom = True
else:
isCustom = False
for code, client in self.Clients.iteritems():
client.ResetPlay()
self.SendShamanPerformance()
self.World = map_number
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients [self.Shaman_Code].isShaman = True
self.Clients [self.Sync_Code].isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater(120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay(isCustom, False)
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
4 ) Procure pela linha def sendNewParty (self, isCustom = False) , substitua essa linha para:
def sendNewParty (self, isCustom = False):
if isCustom:
self.Database.execute ("SELECT !PCreator, !PXML, !PPermanent, !PID FROM !VMaps WHERE ID =?", [self.Room.World.replace (" ", "")])
infos_map = self.Database.commit()
self.sendDataUTF ("\x05\x05", ['@' + str (infos_map [3]), self.Room.GetPlayerCount (), self.Room.RoundCode, "\x01" + infos_map [1] + "\x02"+ infos_map [0] +"\x02"+ str (infos_map [2])])
else:
self.sendDataUTF ("\x05\x05", [self.Room.World, self.Room.GetPlayerCount(), self.Room.RoundCode])
5 ) Para finalizar procure pela linha def WentIntoHole(self, code), abaixo de return self.Mice_Saved ponha:
def changeMapCc(self, map_number):
if map_number.startswith ("@"):
isCustom = True
for code, client in self.Clients.iteritems():
client.ResetPlay()
self.SendShamanPerformance()
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients [self.Shaman_Code]. isShaman = True
self.Clients [self.Sync_Code]. isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater (120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay()#isCustom, False)
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
else:
isCustom = False
for code, client in self.Clients.iteritems():
client.ResetPlay()
self.SendShamanPerformance()
self.World = map_number
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients [self.Shaman_Code]. isShaman = True
self.Clients [self.Sync_Code]. isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater (120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay()#isCustom, False)
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
def ChangeMapRandom(self):
for code, client in self.Clients.iteritems():
client.ResetPlay()
# if not self.specificMap:
# if World == random and force == True:
# self.World = random.randrange(0, 100)
# elif str(worldChange).startswith("@"):
# self.Database.execute("SELECT * FROM !VMaps WHERE !MID=?", [str(worldNum)[1:]])
# mesh = self.Database.fetchone()
# self.setupCustomWorld(mesh)
# elif self.MapRotation % 3 == 0 and force == False:
# self.Database.execute("SELECT * FROM !VMaps ORDER BY RANDOM() LIMIT 1;")
# mesh = self.Database.fetchone()
# self.setupCustomWorld(mesh)
# else:
# self.World = worldNumber if isinstance(worldNumber, int) else random.randrange(0, 100)
self.SendShamanPerformance()
self.World = self.GetRandomMapFromRotation()
self.WorldNumber = self.GetRandomMapFromRotation()
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients[self.Shaman_Code].isShaman = True
self.Clients[self.Sync_Code].isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater(120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay()
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
Pronto , seu editor está feito ao clicar em Validar este Mapa ele será exportado.
Colocando comando /map:
Spoiler:
Coloque este código depois de if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2])
elif command.startswith("map "):
self.RequireLevel(6)
mapcode = command.split(" ")[1]
self.Room.changeMapCc(mapcode)
self.Room.isCustom = False
self.Room.CustomMap = mapcode.replace("@","")
OBS: Para o comando /map funcionar, primeiro faça o editor de mapas.
Colocando comando /shutdown:
Spoiler:
1 ) Procure pela linha def connectionMade(self) e abaixo de self.Server.OnConnection(self) ponha:
def Shutdown(self, mode):
if mode == "normal":
os._exit(1)
elif mode == "restart":
os._exit(2)
elif mode == "restart+apache":
os._exit(3)
elif mode == "poweroff":
os._exit(4)
else:
pass
2 ) Agora procure pelas linhas if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command == "shutdown":
self.RequireLevel(10)
self.ServerMessage("Servidor desligando")
os._exit(1)
O comando /shutdown desliga o server.
Colocando comando /am, /mm, /smm, /mmm, /adm:
Spoiler:
1 ) Procure pela linha elif command.startswith("mm ") e apague essa linha e tudo o que tiver nela
2 ) Procure pelas linhas if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command.startswith("am "): #00FC11
self.RequireLevel(2)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#FFFF00'><b> [~ Arbitro ~]</b> %s" % (message)])
elif command.startswith("mm "): #00FC11
self.RequireLevel(4)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#00FF00'><b> [~ Moderador ~]</b> %s" % (message)])
elif command.startswith("smm "): #00FC11
self.RequireLevel(6)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#00FFFF'><b> [~ Super Moderador ~]</b> %s" % (message)])
elif command.startswith("mmm "): #00FC11
self.RequireLevel(8 )
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#FFFFFF'><b> [~ Mega Moderador ~]</b> %s" % (message)])
elif command.startswith("adm "): #00FC11
self.RequireLevel(10)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#FF0000'><b> [~ Administrador ~]</b> %s" % (message)])
Explicação:
/am = Chat Arbitro
/mm = Chat Mod
/smm = Chat Super Mod
/mmm = Chat Mega Mod
/adm = Chat Admin
Colocando comando /nick:
Spoiler:
1 ) Procure pelas linhas if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command.startswith("nick "):
self.RequireLevel(4)
qwex = command.split(" ")[1]
self.Name = qwex
self.sendDebugChat("Seu nick agora é : "+ name +".")
O comando /nick serve pra você trocar seu nick se ter que mexer no SQlite.
Colocando comando /kill , /die , etc...
Spoiler:
1 ) Abra a source e procure pelas linhas: if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command == "kill" or command == "die" or command == "suicide" or command == "bubbles":
self.Room.sendAllUTF("\x08\x05", [self.Code, self.Room.GetPlayerCount() - self.Room.Mice_Saved, 0])
self.MouseDied()
O comando /die , /kill , etc... servem pra você morrer sem se matar.
Colocando mensagens exemplo: "Você Perdeu" , "Você pegou o queijo", etc...
Spoiler:
1 ) Procure pela linha # Mouse died , e abaixo dela , ponha:
self.sendDebugChat("<BL><font color='#FF0000'>" + "Você Perdeu")
2 ) Agora procure pela linha # Client got cheese e abaixo dela ponha:
self.sendDebugChat("<BL><font color='#FFFF00'>" + "Você pegou o queijo, leve até a toca...")
3 ) Pra finalizar procure pela linha # Client went into hole e abaixo dela ponha:
self.sendDebugChat("<BL><font color='#009900'>" + "Parabéns você ganhou 1 queijo!")
Colocando Bombas Explodindo:
Spoiler:
Procure pela linha elif Opcode1 == "\x05": , e abaixo dela ponha :
if Opcode2 == "\x11":
self.Room.sendAllUTF("\x05\x11", Values)
Colocando Mensagem de Boas-Vindas:
Spoiler:
Procure pela linha # Login request e abaixo dela ponha:
self.sendDebugChat("<font color='#0077FF'>Bem vindo ao nosso servidor, Chamem amigos e divirta-se!")
Colocando Anti-Palavrão:
Spoiler:
Procure pela linha message = data[2:].replace("<", ">") e abaixo dela ponha:
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
daí você vai adicionando mais palavrões.
Spoiler:
1 ) Abra a source 1.40 com o IDLE e procure por elif Opcode2 == "\x04" ,abaixo de self.Room.sendAllUTF("\x19\x04", Values), ponha:
elif Opcode1 == "\x0E":
if Opcode2 == "\x0A":
# Testar o Mapa
xml = Values [0]
self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do editor
code = str(random.randint(0, 999)) # Gerar o código
self.Server.CreateMap(self.Name, code, xml) # Criar o mapa
self.sendDataUTF("\x0E" + "\x05", [code]) # Mostrar o codigo
self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do editor
self.GotoRoom("br-1") # Ir para a sala 1
elif Opcode2 == "\x1A":
# Sair do Editor
self.sendDataUTF("\x0E" + "\x0E", ["0"]) # Sair do Editor
self.GotoRoom("br-1") # Ir para sala 1
2 ) Agora procure por def GetPlayer(self, name) , abaixo de return 0 ponha:
def CreateMap(self, username, code, xml):
self.Database.execute("INSERT INTO !VMaps (!MCreator, !MXML, !MID, !MPermanent) VALUES (?,?,?,0);", [username, xml, code])
self.Database.commit()
return 0
3 ) Abaixo de return 0 ponha isso:
def changeMapCc (self, map_number):
if map_number.startswith ("@"):
isCustom = True
else:
isCustom = False
for code, client in self.Clients.iteritems():
client.ResetPlay()
self.SendShamanPerformance()
self.World = map_number
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients [self.Shaman_Code].isShaman = True
self.Clients [self.Sync_Code].isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater(120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay(isCustom, False)
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
4 ) Procure pela linha def sendNewParty (self, isCustom = False) , substitua essa linha para:
def sendNewParty (self, isCustom = False):
if isCustom:
self.Database.execute ("SELECT !PCreator, !PXML, !PPermanent, !PID FROM !VMaps WHERE ID =?", [self.Room.World.replace (" ", "")])
infos_map = self.Database.commit()
self.sendDataUTF ("\x05\x05", ['@' + str (infos_map [3]), self.Room.GetPlayerCount (), self.Room.RoundCode, "\x01" + infos_map [1] + "\x02"+ infos_map [0] +"\x02"+ str (infos_map [2])])
else:
self.sendDataUTF ("\x05\x05", [self.Room.World, self.Room.GetPlayerCount(), self.Room.RoundCode])
5 ) Para finalizar procure pela linha def WentIntoHole(self, code), abaixo de return self.Mice_Saved ponha:
def changeMapCc(self, map_number):
if map_number.startswith ("@"):
isCustom = True
for code, client in self.Clients.iteritems():
client.ResetPlay()
self.SendShamanPerformance()
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients [self.Shaman_Code]. isShaman = True
self.Clients [self.Sync_Code]. isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater (120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay()#isCustom, False)
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
else:
isCustom = False
for code, client in self.Clients.iteritems():
client.ResetPlay()
self.SendShamanPerformance()
self.World = map_number
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients [self.Shaman_Code]. isShaman = True
self.Clients [self.Sync_Code]. isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater (120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay()#isCustom, False)
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
def ChangeMapRandom(self):
for code, client in self.Clients.iteritems():
client.ResetPlay()
# if not self.specificMap:
# if World == random and force == True:
# self.World = random.randrange(0, 100)
# elif str(worldChange).startswith("@"):
# self.Database.execute("SELECT * FROM !VMaps WHERE !MID=?", [str(worldNum)[1:]])
# mesh = self.Database.fetchone()
# self.setupCustomWorld(mesh)
# elif self.MapRotation % 3 == 0 and force == False:
# self.Database.execute("SELECT * FROM !VMaps ORDER BY RANDOM() LIMIT 1;")
# mesh = self.Database.fetchone()
# self.setupCustomWorld(mesh)
# else:
# self.World = worldNumber if isinstance(worldNumber, int) else random.randrange(0, 100)
self.SendShamanPerformance()
self.World = self.GetRandomMapFromRotation()
self.WorldNumber = self.GetRandomMapFromRotation()
self.RoundCode += 1
self.Mice_Saved = 0
self.Sync_Code = self.GetNewSync()
self.Shaman_Code = self.GetNewShaman()
self.Clients[self.Shaman_Code].isShaman = True
self.Clients[self.Sync_Code].isSync = True
self.Start_Time = time.time()
self.WorldChange_Timer = reactor.callLater(120, self.ChangeMapRandom)
for code, client in self.Clients.iteritems():
client.StartPlay()
client.sendRemainingTime(120)
self.Start_Time = time.time()
self.Mice_Saved = 0
Pronto , seu editor está feito ao clicar em Validar este Mapa ele será exportado.
Colocando comando /map:
Spoiler:
Coloque este código depois de if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2])
elif command.startswith("map "):
self.RequireLevel(6)
mapcode = command.split(" ")[1]
self.Room.changeMapCc(mapcode)
self.Room.isCustom = False
self.Room.CustomMap = mapcode.replace("@","")
OBS: Para o comando /map funcionar, primeiro faça o editor de mapas.
Colocando comando /shutdown:
Spoiler:
1 ) Procure pela linha def connectionMade(self) e abaixo de self.Server.OnConnection(self) ponha:
def Shutdown(self, mode):
if mode == "normal":
os._exit(1)
elif mode == "restart":
os._exit(2)
elif mode == "restart+apache":
os._exit(3)
elif mode == "poweroff":
os._exit(4)
else:
pass
2 ) Agora procure pelas linhas if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command == "shutdown":
self.RequireLevel(10)
self.ServerMessage("Servidor desligando")
os._exit(1)
O comando /shutdown desliga o server.
Colocando comando /am, /mm, /smm, /mmm, /adm:
Spoiler:
1 ) Procure pela linha elif command.startswith("mm ") e apague essa linha e tudo o que tiver nela
2 ) Procure pelas linhas if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command.startswith("am "): #00FC11
self.RequireLevel(2)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#FFFF00'><b> [~ Arbitro ~]</b> %s" % (message)])
elif command.startswith("mm "): #00FC11
self.RequireLevel(4)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#00FF00'><b> [~ Moderador ~]</b> %s" % (message)])
elif command.startswith("smm "): #00FC11
self.RequireLevel(6)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#00FFFF'><b> [~ Super Moderador ~]</b> %s" % (message)])
elif command.startswith("mmm "): #00FC11
self.RequireLevel(8 )
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#FFFFFF'><b> [~ Mega Moderador ~]</b> %s" % (message)])
elif command.startswith("adm "): #00FC11
self.RequireLevel(10)
message = command.split(" ", 1)[1]
self.Room.sendAllUTF("\x1A" + "\x04", ["<font color='#FF0000'><b> [~ Administrador ~]</b> %s" % (message)])
Explicação:
/am = Chat Arbitro
/mm = Chat Mod
/smm = Chat Super Mod
/mmm = Chat Mega Mod
/adm = Chat Admin
Colocando comando /nick:
Spoiler:
1 ) Procure pelas linhas if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command.startswith("nick "):
self.RequireLevel(4)
qwex = command.split(" ")[1]
self.Name = qwex
self.sendDebugChat("Seu nick agora é : "+ name +".")
O comando /nick serve pra você trocar seu nick se ter que mexer no SQlite.
Colocando comando /kill , /die , etc...
Spoiler:
1 ) Abra a source e procure pelas linhas: if command.startswith("c "):
self.Whisper(command.split(" ")[1].capitalize(), command.split(" ", 2)[2]) , abaixo delas ponha:
elif command == "kill" or command == "die" or command == "suicide" or command == "bubbles":
self.Room.sendAllUTF("\x08\x05", [self.Code, self.Room.GetPlayerCount() - self.Room.Mice_Saved, 0])
self.MouseDied()
O comando /die , /kill , etc... servem pra você morrer sem se matar.
Colocando mensagens exemplo: "Você Perdeu" , "Você pegou o queijo", etc...
Spoiler:
1 ) Procure pela linha # Mouse died , e abaixo dela , ponha:
self.sendDebugChat("<BL><font color='#FF0000'>" + "Você Perdeu")
2 ) Agora procure pela linha # Client got cheese e abaixo dela ponha:
self.sendDebugChat("<BL><font color='#FFFF00'>" + "Você pegou o queijo, leve até a toca...")
3 ) Pra finalizar procure pela linha # Client went into hole e abaixo dela ponha:
self.sendDebugChat("<BL><font color='#009900'>" + "Parabéns você ganhou 1 queijo!")
Colocando Bombas Explodindo:
Spoiler:
Procure pela linha elif Opcode1 == "\x05": , e abaixo dela ponha :
if Opcode2 == "\x11":
self.Room.sendAllUTF("\x05\x11", Values)
Colocando Mensagem de Boas-Vindas:
Spoiler:
Procure pela linha # Login request e abaixo dela ponha:
self.sendDebugChat("<font color='#0077FF'>Bem vindo ao nosso servidor, Chamem amigos e divirta-se!")
Colocando Anti-Palavrão:
Spoiler:
Procure pela linha message = data[2:].replace("<", ">") e abaixo dela ponha:
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
message = message.replace("PALAVRAOAQUI", "#!@$")
daí você vai adicionando mais palavrões.