mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k]) CheeseListDisp.append([5, mSL, CheeseList[mSL]]) del CheeseList[mSL] self.sendData("\x1A" + "\x04", ["Shaman (Mice saved)"]) self.sendData("\x1A" + "\x04", [""+str(SaveListDisp[0][0])+" - "+str(SaveListDisp[0][1])+" - "+str(SaveListDisp[0][2])]) self.sendData("\x1A" + "\x04", [""+str(SaveListDisp[1][0])+" - "+str(SaveListDisp[1][1])+" - "+str(SaveListDisp[1][2])]) self.sendData("\x1A" + "\x04", [""+str(SaveListDisp[2][0])+" - "+str(SaveListDisp[2][1])+" - "+str(SaveListDisp[2][2])]) self.sendData("\x1A" + "\x04", [""+str(SaveListDisp[3][0])+" - "+str(SaveListDisp[3][1])+" - "+str(SaveListDisp[3][2])]) self.sendData("\x1A" + "\x04", [""+str(SaveListDisp[4][0])+" - "+str(SaveListDisp[4][1])+" - "+str(SaveListDisp[4][2])]) self.sendData("\x1A" + "\x04", ["Mouse (Cheese gathered)"]) self.sendData("\x1A" + "\x04", [""+str(CheeseListDisp[0][0])+" - "+str(CheeseListDisp[0][1])+" - "+str(CheeseListDisp[0][2])]) self.sendData("\x1A" + "\x04", [""+str(CheeseListDisp[1][0])+" - "+str(CheeseListDisp[1][1])+" - "+str(CheeseListDisp[1][2])]) self.sendData("\x1A" + "\x04", [""+str(CheeseListDisp[2][0])+" - "+str(CheeseListDisp[2][1])+" - "+str(CheeseListDisp[2][2])]) self.sendData("\x1A" + "\x04", [""+str(CheeseListDisp[3][0])+" - "+str(CheeseListDisp[3][1])+" - "+str(CheeseListDisp[3][2])]) self.sendData("\x1A" + "\x04", [""+str(CheeseListDisp[4][0])+" - "+str(CheeseListDisp[4][1])+" - "+str(CheeseListDisp[4][2])]) self.sendData("\x1A" + "\x04", ["Mouse (First places)"]) self.sendData("\x1A" + "\x04", [""+str(FirstListDisp[0][0])+" - "+str(FirstListDisp[0][1])+" - "+str(FirstListDisp[0][2])]) self.sendData("\x1A" + "\x04", [""+str(FirstListDisp[1][0])+" - "+str(FirstListDisp[1][1])+" - "+str(FirstListDisp[1][2])]) self.sendData("\x1A" + "\x04", [""+str(FirstListDisp[2][0])+" - "+str(FirstListDisp[2][1])+" - "+str(FirstListDisp[2][2])]) self.sendData("\x1A" + "\x04", [""+str(FirstListDisp[3][0])+" - "+str(FirstListDisp[3][1])+" - "+str(FirstListDisp[3][2])]) self.sendData("\x1A" + "\x04", [""+str(FirstListDisp[4][0])+" - "+str(FirstListDisp[4][1])+" - "+str(FirstListDisp[4][2])]) elif event.startswith("retrieve "): if EVENTCOUNT == 2: if self.privilegeLevel == 10 and not self.isDrawer: mapz = event_raw.split(" ", 1)[1] dbcur.execute('select time from racing where map = ?', [mapz]) rrf = str(dbcur.fetchone()) timez = str(rrf).replace("(u'", "") timez = str(timez).replace("',)", "") dbcur.execute('select name from racing where map = ?', [mapz]) rrf2 = str(dbcur.fetchone()) usernamez = str(rrf2).replace("(u'", "") usernamez = str(usernamez).replace("',)", "") self.sendModMessage(0, 'Best time on this map was %ss by %s!' % (timez, usernamez)) elif event.startswith("ls "): username = event_raw.split(" ", 1)[1] if EVENTCOUNT == 2: if self.privilegeLevel >= 3 and not self.isDrawer: room = self.server.findPlayer(username) if room == "Offline": self.sendData("\x1A" + "\x04", ["[Serveur] %s is offline." % (username)]) else: self.sendData("\x1A" + "\x04", ["[Serveur] %s -> %s" % (username, room)]) elif event.startswith("givetitle "): if EVENTCOUNT == 4: if self.privilegeLevel == 10 and not self.isDrawer: _, playerCode, titlenum, username = event_raw.split(" ", 3) self.sendUnlockedTitle(playerCode, titlenum) title = '["1","%s"]' % (titlenum) self.server.banPlayer(username, "0", "AutoBan: Updating your shop cheese", self.username) self.sendPlayerBanMessage(username, "0", "AutoBan: Updating your titles") dbcur.execute('UPDATE users set titlelist = ? WHERE name = ?', [title, username]) else: pass else: pass elif event.startswith("doublesham "): if EVENTCOUNT == 3: if self.privilegeLevel == 10 and not self.isDrawer: _, sham1, sham2 = event_raw.split(" ", 2) self.sendDoubleShamanCode(sham1, sham2) #elif event.startswith("cmap "): #if EVENTCOUNT == 2: #mapcodez = event_raw.split(" ", 1)[1] #self.room.isCustom = True #self.room.customMap = mapcodez #self.room.killAll() elif event.startswith("snpc "): if self.privilegeLevel==10 or self.privilegeLevel==6 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] acount=0 while acount<100: x = random.randrange(1, 800) y = random.randrange(1, 400) npcid = random.randrange(1, 1000000000) npcid = 0-npcid self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, "0,0,0,0,0", x, y, "1", "0"]) acount+=1 self.sendData("\x06" + "\x14", ["Spammed npc's. (%s 0,0,0,0,0)"%(username)]) if EVENTCOUNT == 3: _, username, shopitems = event_raw.split(" ", 2) acount=0 while acount<100: x = random.randrange(1, 800) y = random.randrange(1, 400) npcid = random.randrange(1, 1000000000) npcid = 0-npcid self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, shopitems, x, y, "1", "0"]) acount+=1 self.sendData("\x06" + "\x14", ["Spammed npc's. (%s %s)"%(username, shopitems)]) if EVENTCOUNT == 5: _, username, shopitems, x, y = event_raw.split(" ", 4) acount=0 x = x y = y npcid = random.randrange(1, 1000000000) npcid = 0-npcid self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, shopitems, x, y, "1", "1"]) self.sendData("\x06" + "\x14", ["Spawned npc. (%s, %s, %s, %s)"%(username,shopitems,x,y)])