def last_words(self): if (std.lynchTarget == self.num): std.message("The Town has decided to lynch you!") std.party.players[self.num]["last_words"] = andro.dialogGetInput( "Last words", "Do you have any last words?") else: std.message("The Town has decided to lynch " + std.party.players[std.lynchTarget]["name"])
def lynch(self): if (std.lynchTarget == self.num): std.message("You are being lynched!") self.lynchMessage = andro.dialogGetInput( "Defence", "Do you have something in defence?").result else: std.message("The Town has decided to put " + std.lynchTarget + " on trial")
def pre_night(self): std.message( std.party.players[std.lynchTarget]["name"] + " : " + std.party.players[std.lynchTarget]["last_words"], 5) i = 0 while (i < len(std.party.players[std.lynchTarget]["last_will"])): std.message(std.party.players[std.lynchTarget]["last_will"][i], 3) i += 1
def pre_day(self): """ Death announcements. """ i = 0 while (i < len(std.newDeads)): std.message(std.newDeads[i]["name"] + " was found dead last night.")
def chat(self, night): if (self.state == "jailed"): std.message("You were hauled off to jail!", 2) self.jailMessage = andro.dialogGetInput( "Defence", "Do you have something to say to Jailor?") if (self.state == "bmd"): std.message("You are blackmailed!", 2) andro.dialogDismiss() if (not self.state == "bmd" and not night): chat.say( andro.dialogGetInput( "Chat", "Would you wish to say something?").result, self.name)
import tos_origin import sqlite3 from random import Random from androidhelper import Android rnd = Random() andro = Android() conn = sqlite3.connect("/mnt/sdcard/com.hipipal.qpyplus/scripts/ToS/data.db") cur = conn.cursor() cur.execute("SELECT * FROM `All Any`") print cur.fetchall() # cur.execute("CREATE TABLE `user_mods` (name varchar(50), role1 varchar(25), role2 varchar(25), role3 varchar(25), role4 varchar(25), role5 varchar(25), role6 varchar(25), role7 varchar(25), role8 varchar(25), role9 varchar(25), role10 varchar(25), role11 varchar(25), role12 varchar(25), role13 varchar(25), role14 varchar(25), role15 varchar(25))") name = andro.dialogGetInput("Name", "Enter a name for the mod.").result if (not name): name = str(rnd.randint(1, 99999999999)) cur.execute("CREATE TABLE `" + name + "`(role varchar(25))") cur.execute("INSERT INTO `" + name + "` VALUES('" + name + "')") i = 0 while (i < tos_origin.MAX_LIMIT): role = "Any" if (role in tos_origin.ROLES or role in tos_origin.RANDOMS): cur.execute("INSERT INTO `" + name + "` VALUES('" + role + "')") i += 1 else: std.message("Enter a valid role!") conn.close()
def innocent(self): if (std.lynchTarget == self.num): std.message("The Town has decided to lynch you!") else: std.message("The Town has decided to pardon " + std.party.players[std.lynchTarget]["name"])
def defence(self): if (not std.lynchTarget == self.num): std.message( std.party.players[std.lynchTarget]["name"] + " : " + std.party.players[std.lynchTarget]["message"], 5)