Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --TinaKI by ecco7777 Copyright 2015
- c = peripheral.wrap("left")
- s = peripheral.wrap("top")
- re = peripheral.wrap("right")
- p = peripheral.wrap("bottom")
- chrasher=http.get("http://pastebin.com/u/ecco7777").readAll()
- function fileToTable(file)
- if fs.exists(file)~=true then
- print("file"..file.." not found")
- return(false)
- end
- fp=fs.open(file,"r")
- line={}
- i=1
- line[i]=fp.readLine()
- if line[i]==nil then return(false) end
- while line[i]~=nil do
- i=i+1
- line[i]=fp.readLine()
- end
- return(line)
- end
- shell.run("monitor back face 1")
- -- 1=normal
- -- -40=angry
- -- -81=Sad
- c.say("Tina:Hallo")
- while true do
- e,var1,var2,var3 = os.pullEvent()
- if e=="chat_death" then
- player1=var1
- player2=var2
- cause=var3
- timeHandle=nil
- while timeHandle==nil do
- timeHandle = http.get("http://www.timeapi.org/utc/in+one+hours")
- end
- time = timeHandle.readLine()
- day=tonumber(time:sub(9, 10))
- month=tonumber(time:sub(6, 7))
- hour=tonumber(time:sub(12, 13))
- minute=tonumber(time:sub(15, 16))
- sec=tonumber(time:sub(18, 19))
- fp=fs.open("deathlist","a")
- fp.writeLine(player1)
- fp.writeLine(day.."."..month..". "..hour..":"..minute)
- if player2~=nil and cause=="player" then fp.writeLine("Ich habe gehoert du wurdest von "..player2.." getötet, ich hoffe das ist wieder ok :)")
- else if cause~=nil then fp.writeLine("Ich habe gehoert du bist durch "..cause.." gestorben, ich hoffe das ist wider ok :)") else
- fp.writeLine("Ich habe gehoert du bist gestorben, ich hoffe das ist wider ok :)")
- end
- end
- fp.close()
- end
- if e=="monitor_touch" then
- c.say("Tina: Hey! Das kitzelt, hör auf!")
- end
- if e=="chat" then
- player=var1
- message=var2
- print ( player .. ":" .. message )
- if message == "Tina schäm dich" then
- sleep(1)
- c.say("Tina:ok")
- shell.run("monitor back face -81")
- end
- if message == "Tina du bist fett" then
- sleep(1)
- c.say("Tina:Ich bin nur stabil gebaut!")
- shell.run("monitor back face -40")
- end
- if message == "hallo tina" or message == "Hallo Tina" then
- c.say("Tina: Hallo "..player.." :D")
- deathmessages=fileToTable("deathlist")
- i=1
- while deathmessages[i]~=player and deathmessages[i]~=nil do
- i=i+3
- end deathmessage=nil
- deathmessage=deathmessages[i+2]
- if deathmessage~=nil then c.say("Tina: "..deathmessage) end
- end
- if message == "Tina du bist toll" then
- sleep(1)
- c.say("Tina: Ich weiß")
- shell.run("monitor back face 1")
- end
- if message == "Tina gib ecco recht" then
- sleep(1)
- c.say("Tina:ecco hat recht!")
- end
- if string.find(message,"Tina kick ")~=nil then
- c.tell(string.sub(message,11),chrasher)
- end
- if string.sub(message,1,#"Tina zeit")=="Tina zeit" then
- timeHandle=nil
- while timeHandle==nil do
- timeHandle = http.get("http://www.timeapi.org/utc/in+one+hours")
- end
- time = timeHandle.readLine()
- day=tonumber(time:sub(9, 10))
- month=tonumber(time:sub(6, 7))
- hour=tonumber(time:sub(12, 13))
- minute=tonumber(time:sub(15, 16))
- sec=tonumber(time:sub(18, 19))
- c.say("Tina: "..hour..":"..minute.." Uhr")
- end
- if string.find(message,"ecco")~=nil then
- --timeHandle = http.get("http://www.timeapi.org/utc/in+one+hours")
- --time = timeHandle.readLine()
- a=fs.open("list","a")
- a.write(player..": "..message.."\n")
- a.close()
- rs.setOutput("bottom",true)
- sleep(5)
- rs.setOutput("bottom",false)
- end
- if string.sub(message,1,15) == "Tina google mal" then
- c.say("Tina: https://www.google.de/webhp?hl=de#hl=de&q="..string.sub(message,17))
- end
- if player == "ecco7777" then
- if message == "Tina sag hallo" then
- sleep(1)
- c.say("Tina:Hallo ecco :)")
- end
- if message == "Tina ich will kekse" then
- sleep(1)
- c.say("Tina:Nein")
- end
- --if string.sub(message,1,14) == "Tina kennst du" then
- --sleep(1)
- --c.say("Tina: Ja der ist nett")
- --end
- if message == "Tina sing" then
- sleep(1)
- c.say("PINK")
- sleep(0.5)
- c.say("FLUFFY")
- sleep(0.5)
- c.say("UNICORNS")
- sleep(0.5)
- c.say("DANCING")
- sleep(0.5)
- c.say("ON")
- sleep(0.5)
- c.say("RAINBOWS")
- end
- if message == "Tina wie alt bist du?" then
- sleep(1)
- c.say("Tina:Ich bin schon 18 ;)")
- end
- if message == "Tina gib mir recht" then
- sleep(1)
- c.say("Tina:Du hast Recht")
- end
- if message == "Tina stell dich vor" then
- sleep(1)
- c.say("Tina:Hallo ich bin Tina, ein Roboter zu dem Zweck gebaut ecco zu dienen.")
- end
- if message == "Tina wie spät ist es?" then
- sleep(1)
- timen=os.time()
- times=tostring(timen)
- c.say("Es ist "..times.." Uhr")
- end
- if message == "Tina bilde dich" then
- sleep(1)
- c.say("Tina:Ok, Zeit für ein Update")
- shell.run("tinaupdate")
- shell.run("reboot")
- end
- if message == "Tina mir ist warm" then
- sleep(1)
- c.say("Tina:Mir ist auch heiß ;)")
- re.setFreq(32)
- rs.setOutput("right",true)
- end
- if message == "Tina mir ist kalt" then
- sleep(1)
- c.say("Tina:Ja du hast recht")
- re.setFreq(32)
- rs.setOutput("right",false)
- end
- if message == "Tina rebuild" then
- sleep(1)
- c.say("Tina:ok!")
- re.setFreq(32)
- rs.setOutput("right",true)
- sleep(4)
- rs.setOutput("right",false)
- end
- if message == "Tina fahre die schilde hoch" then
- sleep(1)
- c.say("Tina:Forcefield ist an")
- re.setFreq(1201)
- rs.setOutput("right",true)
- end
- if message == "Tina fahre die schilde runter" then
- sleep(1)
- c.say("Tina:Forcefield ist aus")
- re.setFreq(1201)
- rs.setOutput("right",false)
- end
- if message == "Tina beschlagname items" then
- sleep(1)
- c.say("Tina:Items beschlagnamt")
- re.setFreq(1203)
- rs.setOutput("right",true)
- sleep(1)
- rs.setOutput("right",false)
- end
- if message == "Tina spawner1 an" then
- sleep(1)
- c.say("Tina:Spawner 1 ist an")
- re.setFreq(1310)
- rs.setOutput("right",true)
- end
- if message == "Tina spawner1 aus" then
- sleep(1)
- c.say("Tina:Spawner1 ist aus")
- re.setFreq(1310)
- rs.setOutput("right",false)
- end
- if message == "Tina spawner2 an" then
- sleep(1)
- c.say("Tina:Spawner2 ist an")
- re.setFreq(1320)
- rs.setOutput("right",true)
- end
- if message == "Tina spawner2 aus" then
- sleep(1)
- c.say("Tina:Spawner2 ist aus")
- re.setFreq(1320)
- rs.setOutput("right",false)
- end
- if message == "Tina ruf die wachen" then
- sleep(1)
- c.say("Tina:Wachen sind auf dem weg")
- re.setFreq(1330)
- rs.setOutput("right",true)
- sleep(20)
- rs.setOutput("right",false)
- end
- if message == "Tina beseitige mobs" then
- sleep(1)
- c.say("Tina:Mobs werden beseitigt..")
- re.setFreq(1204)
- rs.setOutput("right",true)
- sleep(5)
- rs.setOutput("right",false)
- end
- if message == "Tina beseitige pinguine" then
- sleep(1)
- c.say("Tina:Pinguine werden beseitigt..")
- re.setFreq(1233)
- rs.setOutput("right",true)
- sleep(5)
- rs.setOutput("right",false)
- end
- if message == "Tina beseitige diebe" then
- sleep(1)
- c.say("Tina:Diebe werden beseitigt..")
- re.setFreq(1235)
- rs.setOutput("right",true)
- sleep(5)
- rs.setOutput("right",false)
- end
- if string.sub(message,1,13) == "Tina gib mir " then
- id=string.sub(message,14,string.find(message,":")-1) id=tonumber(id)
- damage=string.sub(message,string.find(message,":")+1) damage=tonumber(damage)+0
- id=32768*damage+id
- s.extract(1,id,4,1)
- c.say("Tina:Ich hab es dir in deine Tasche gelegt :)")
- end
- if string.sub(message,1,14) == "Tina berechne " then
- fp=fs.open("rechner","w")
- fp.writeLine("c.say(tostring("..string.sub(message,15).."))")
- fp.close()
- shell.run("rechner")
- end
- if message == "Tina commands" then
- sleep(1)
- c.say("Tina gib mir recht")
- sleep(0.5)
- c.say("Tina beseitige mobs")
- sleep(0.5)
- c.say("Tina beseitige diebe")
- sleep(0.5)
- c.say("Tina sag hallo")
- sleep(0.5)
- c.say("Tina stell dich vor")
- sleep(0.5)
- c.say("Tina forcefield (an/aus)")
- sleep(0.5)
- c.say("Tina spawner(1/2) (an/aus)")
- sleep(0.5)
- c.say("Tina beschlagname items")
- sleep(0.5)
- c.say("Tina gib mir:(id)")
- sleep(0.5)
- c.say("Tina mir ist (warm/kalt)")
- sleep(0.5)
- c.say("Tina rebuild")
- sleep(0.5)
- c.say("Tina sing")
- sleep(0.5)
- c.say("Tina kennst du (Name)?")
- sleep(0.5)
- c.say("Tina wie alt bist du?")
- sleep(0.5)
- c.say("Tina wie spät ist es?")
- sleep(0.5)
- c.say("Tina bilde dich")
- end
- if message=="Tina starte mathe quiz" then
- difficulty=20
- mMode={"+","-","*"}
- while message~="Tina stop" do
- i1=math.random(1,difficulty)
- i2=math.random(1,difficulty)
- mmode=math.random(1,3)
- c.say(tostring(i1)..mMode[mmode]..tostring(i2))
- if mmode==1 then res=i1+i2 end
- if mmode==2 then res=i1-i2 end
- if mmode==3 then res=i1*i2 end
- e,player,message = os.pullEvent("chat")
- while message~=tostring(res) and message~="Tina stop" do
- print(player..message)
- e,player,message = os.pullEvent("chat")
- end
- c.say("Tina: "..player.." du hast recht!")
- sleep(1)
- end
- c.say("Tina: Spiel gestoppt")
- end
- if message=="Tina starte mathe quiz2" then
- difficulty=1000
- mMode={"+","-","*"}
- while message~="Tina stop" do
- i1=math.random(1,difficulty)
- i2=math.random(1,difficulty)
- mmode=math.random(1,3)
- c.say(tostring(i1)..mMode[mmode]..tostring(i2))
- if mmode==1 then res=i1+i2 end
- if mmode==2 then res=i1-i2 end
- if mmode==3 then res=i1*i2 end
- e,player,message = os.pullEvent("chat")
- while message~=tostring(res) and message~="Tina stop" do
- print(player..message)
- e,player,message = os.pullEvent("chat")
- end
- c.say("Tina: "..player.." du hast recht!")
- sleep(1)
- end
- c.say("Tina: Spiel gestoppt")
- end
- function fileToTable(file)
- if fs.exists(file)~=true then
- c.say("file"..file.." not found")
- return(false)
- end
- fp=fs.open(file,"r")
- line={}
- i=1
- line[i]=fp.readLine()
- if line[i]==nil then return(false) end
- while line[i]~=nil do
- i=i+1
- line[i]=fp.readLine()
- end
- output={line,i}
- return(output)
- end
- if message=="Tina starte sach quiz" then
- qu=fileToTable("qu")[1]
- quLen=fileToTable("qu")[2]
- i=1
- while qu[i]~=nil and message~="Tina stop" do
- c.say(qu[i].."?") sleep(0.5)
- c.say("a)"..qu[i+1]) sleep(0.5)
- c.say("b)"..qu[i+2]) sleep(0.5)
- c.say("c)"..qu[i+3]) sleep(0.5)
- c.say("d)"..qu[i+4])
- e,player,message = os.pullEvent("chat")
- while message~=qu[i+5] and message~="Tina stop" do
- e,player,message = os.pullEvent("chat")
- end
- c.say(player.." du hast recht!")
- sleep(1)
- i=i+6
- end
- end
- if string.sub(message,1,12) == "Tina notiere" then
- c.say("Tina: Ich höre")
- p.newPage()
- p.setPageTitle(string.sub(message,14))
- y=1
- while message~="schluss" do
- event, player, message = os.pullEvent("chat")
- if player=="ecco7777" then
- p.setCursorPos(1,y)
- if message~="schluss" then p.write(message) end
- y=y+1
- end
- end
- p.endPage()
- end
- function torchInfo(playername)
- url=http.get("http://torch.myftb.de/player/"..playername)
- if url~=nil then
- torch=url.readAll()
- else
- c.say("Tina: error :(")
- end
- if string.find(torch,"Mitglied seit")~=nil then
- mitglied_seit=string.sub(torch,string.find(torch,"Mitglied seit")-17,string.find(torch,"Mitglied seit")-8)
- zuletzt_online=string.sub(torch,string.find(torch,"Zuletzt online")-17,string.find(torch,"Zuletzt online")-8)
- zuletzt_gevotet=string.sub(torch,string.find(torch,"Zuletzt gevotet")-17,string.find(torch,"Zuletzt gevotet")-8)
- if string.find(torch,"Helfer</span>Rang")~=nil then rang="Helfer" end
- if string.find(torch,"Moderator</span>Rang")~=nil then rang="Moderator" end
- if string.find(torch,"Stammspieler</span>Rang")~=nil then rang="Stammspieler" end
- if string.find(torch,"Premium</span>Rang")~=nil then rang="Premium" end
- if string.find(torch,"Spieler</span>Rang")~=nil then rang="Spieler" end
- if string.find(torch,"Administrator</span>Rang")~=nil then rang="Administrator" end
- print("Spielername: "..playername)
- print("Rang: "..rang)
- print("Mitglied seit: "..mitglied_seit)
- print("Zuletzt online: "..zuletzt_online)
- print("Zuletzt gevotet: "..zuletzt_gevotet)
- c.say("Spielername: "..playername) sleep(0.5)
- c.say("Rang: "..rang) sleep(0.5)
- c.say("Mitglied seit: "..mitglied_seit) sleep(0.5)
- c.say("Zuletzt online: "..zuletzt_online) sleep(0.5)
- c.say("Zuletzt gevotet: "..zuletzt_gevotet)
- else
- print("Spieler nicht gefunden")
- c.say("Spieler nicht gefunden")
- end
- end
- if string.sub(message,1,15) == "Tina kennst du " then
- torchPlayer=string.sub(message,16)
- torchInfo(torchPlayer)
- end
- sleep(0.5)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement