Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _,f in next,{"AutoShaman","AutoScore","AutoNewGame","AutoTimeLeft","AutoScore","PhysicalConsumables","DebugCommand","MinimalistMode"} do
- tfm.exec["disable"..f](true)
- end
- for _,g in next,{"p","rank","help"} do
- system.disableChatCommandDisplay(g,true)
- end
- sudden=false
- powerups=true
- winner=""
- data={}
- players_table={}
- increase=0
- intensity=40
- nightmode=false
- night=0
- mices=0
- remain=10
- last_win=""
- times=1;
- enabled=false
- function split(t,s)
- local a={}
- for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do
- table.insert(a,i)
- end
- return a
- end
- function eventRanking(name)
- local sc = {}
- for id, name in pairs(players_table) do
- sc[#sc+1] = {n=name,s=data[name].score,f=data[name].wins}
- end
- table.sort(sc,function(a,b) return a.s>b.s end)
- str1 = ''
- str2 = ''
- str3 = ''
- for k,v in pairs(sc) do
- if k < 11 then
- if str ~= '' then
- str1=str1.."<br><N>"..k.."° | <VP>"..v.n..""
- str2=str2.."<br><b><N>"..v.s.."</b>"
- str3=str3.."<br><N>"..v.f..""
- else
- str1="<J>"..k.."° | <VP>"..v.n..""
- str2="<J><b>"..v.s.."</b>"
- str3="<J>"..v.f..""
- end
- end
- end
- ui.addTextArea(8000,'<B><J><font size="13"><p align="center">Temporary Ranking',name,100,100,500,30,nil,0x2e424d,nil,true)
- ui.addTextArea(8001,"<B><font size='13'><font face='Consolas'># Name Score Wins",name,110,110,480,20,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8002,"<B><font size='16'><font face='Consolas'>"..str1,name,110,130,480,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8003,"<p align='right'><font size='16'><font face='Consolas'>"..str2,name,400,130,60,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8004,"<p align='right'><font size='16'><font face='Consolas'>"..str3,name,485,130,60,220,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8006,"<p align='center'><font size='16'><R><a href='event:close'>Close</a>",name,300,350,210,20,0x3c5063,0x3c5063,nil,true)
- end
- function eventChatCommand(name,message)
- local arg = split(message, " ")
- if arg[1] == "p" then
- if arg[2] then
- nome = arg[2]:lower():gsub('%a', string.upper, 1)
- else
- nome = name
- end
- if tfm.get.room.playerList[nome] then
- ui.addTextArea(8003,'<B><J><font size="17"><p align="center">'..nome,name,245,95,315,30,nil,0x2e424d,nil,true)
- ui.addTextArea(8004,"<font size='12'><b>Score: "..data[nome].score.."</b><br><br>Wins: "..data[nome].wins.."<br>Matches: "..data[nome].matches.."",name,255,125,290,90,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(8005,"<R><p align='center'><B><a href='event:fechar'>Close</a>",name,255,210,290,20,0x3c5063,0x3c5063,nil,true)
- else
- tfm.exec.chatMessage("Function not allowed",name)
- end
- end
- if message == "rank" then
- eventRanking(name)
- end
- if message == "help" then
- ui.addTextArea(9000,"<B><J><font size='13'><p align='center'>Help",name,100,90,600,30,nil,0x2e424d,nil,true)
- ui.addTextArea(9005,"<font size='13'><font face='Consolas'>The objetive of this module is kill the other players using the mouse to generate spirits.<br><br>At moment, 3 powerups are available:<br>F1 = Fast Spirits (700 points)<br>F2 = Double Power (250 points)<br>F3 = Box Meteor (550 points)<br>F4 = Night Mode (400 points)<br>F5 = Ultra Explosion (1000 points)<br><br>Module made by Jessiewind26#2546 and Caitlyndma7#0000",name,150,125,500,175,0x0e232b,0x0e232b,nil,true)
- ui.addTextArea(9006,"<font size='13'><R><a href='event:closep'>Close</a>",name,300,297,190,20,0x3c5063,0x3c5063,nil,true)
- end
- end
- function eventNewPlayer(name)
- system.bindMouse(name)
- if not data[name] then
- table.insert(players_table,name)
- data[name]={time=0,matches=0,wins=0,score=0,p1=false,p2=false,pcount=0}
- end
- ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,376,70,24,0x000001,0x000001,0.75,true)
- for i=112,123 do
- tfm.exec.bindKeyboard(name,i,true,true)
- system.bindMouse(name,true)
- end
- tfm.exec.chatMessage("<br>Welcome to module #clickwar!<br>Use the mouse to generate explosions and kill other mices!<br><br>Module made by Jessiewind26#2546 and Caitlyndma7#0000",name)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventMouse(name,x,y)
- if not tfm.get.room.playerList[name].isDead and enabled == true then
- if data[name].p1 == false then
- if data[name].time >= 2 then
- if data[name].p2 == true then
- tfm.exec.explosion(x,y,intensity,intensity*2,false)
- else
- tfm.exec.explosion(x,y,intensity/2,intensity*1.5,false)
- end
- data[name].time=0;
- tfm.exec.displayParticle(10,x,y,0,0,0,0,nil)
- end
- else
- if data[name].p2 == true then
- tfm.exec.explosion(x,y,intensity,intensity*2,false)
- else
- tfm.exec.explosion(x,y,intensity/2,intensity*1.5,false)
- end
- data[name].time=2;
- tfm.exec.displayParticle(10,x,y,0,0,0,0,nil)
- end
- end
- end
- function eventNewGame()
- ui.removeTextArea(1,nil)
- sudden=false
- tfm.exec.setGameTime(120)
- winner=""
- increase=0;
- remain=10
- enabled=false
- intensity=40
- prox=false;
- for name,player in pairs(tfm.get.room.playerList) do
- data[name].matches=data[name].matches+1
- data[name].p1=false
- data[name].p2=false
- data[name].pcount=0
- end
- tfm.exec.chatMessage("<br>Welcome to module #clickwar!<br>Use the mouse to generate explosions and kill other mices!<br><br>Module made by Jessiewind26#2546 and Caitlyndma7#0000",name)
- end
- function eventLoop(pass,falt)
- if pass > 1200 and pass < 1700 then
- tfm.exec.chatMessage("Playing map <J>"..tfm.get.room.currentMap.."<BL> made by <J>"..tfm.get.room.xmlMapInfo.author)
- end
- if nightmode == true then
- night=night+1
- if night >= 4 then
- ui.removeTextArea(2571,nil)
- night=0
- nightmode=false
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- if data[name].pcount >= 0 then
- data[name].pcount=data[name].pcount-1
- else
- data[name].p1=false
- data[name].p2=false
- break
- end
- end
- if sudden == true then
- intensity=intensity+2
- if falt < 20000 then
- intensity=intensity+1
- end
- for name,player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[name].isDead then
- data[name].score=math.floor(data[name].score+(intensity/40))
- end
- end
- end
- if falt < 50000 and falt > 49375 then
- tfm.exec.chatMessage("The ultra hard mode will be enabled in 10 seconds!",nil)
- end
- if falt < 40000 and sudden == false and falt > 30000 then
- tfm.exec.chatMessage("<R>Ultra hard mode enabled!",nil)
- ui.addTextArea(1,"",nil,-1000,-1000,3000,3000,0x000001,0x000001,0.8,false)
- sudden=true;
- end
- if falt < 20000 and sudden == true and falt > 19000 then
- ui.addTextArea(1,"",nil,-1000,-1000,3000,3000,0x000001,0x000001,0.91,false)
- end
- if falt < 10000 and sudden == true and falt > 9000 then
- ui.addTextArea(1,"",nil,-1000,-1000,3000,3000,0x000001,0x000001,0.96,false)
- end
- if falt < 100 then
- tfm.exec.newGame("#10")
- end
- if prox == false then
- ui.setMapName("<N>Click War RTM 2211.005 <BL>| <N>Intensity: <b>"..intensity.."</b>")
- else
- ui.setMapName("<b>"..winner.."</b> <N>wons the match! Next match on "..math.floor(falt/1000).." seconds.<")
- end
- remain=remain-0.5
- if remain <= 3 and remain >= 0.5 then
- ui.addTextArea(0,"<font size='33'><p align='center'>"..math.ceil(remain).."",nil,370,350,60,45,0x000001,0x000001,0.8,true)
- end
- if remain <= 0 then
- ui.removeTextArea(0,nil)
- enabled=true;
- end
- for name,player in pairs(tfm.get.room.playerList) do
- data[name].time=data[name].time+1
- end
- if enabled == true then
- increase=increase+0.5
- if increase >= 2 then
- if sudden == false then
- intensity=intensity+1
- increase=0;
- for name,player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[name].isDead then
- if pass > 30000 then
- data[name].score=math.floor(data[name].score+(intensity/24))
- end
- end
- end
- end
- end
- end
- end
- function eventPlayerDied(name)
- if name == last_win and times >= 2 then
- tfm.exec.chatMessage("The victory sequence of <R>"..last_win.."<J> has been ended!")
- times=1
- end
- local i=0
- local n
- for pname,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- n=pname
- end
- end
- if i==0 then
- tfm.exec.newGame("#10")
- elseif i==1 then
- winner=n;
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- data[n].wins=data[n].wins+1
- data[n].score=data[n].score+200
- tfm.exec.setGameTime(10)
- tfm.exec.setPlayerScore(n,1,true)
- prox=true;
- if winner == last_win then
- data[n].score=data[n].score+100
- times=times+1
- if times == 2 then
- tfm.exec.chatMessage("<J>"..last_win.." wons <b>2</b> times in a row!")
- elseif times >= 3 then
- tfm.exec.chatMessage("<R><b>Legendary!</b><J> "..last_win.." wons <b>3</b> times in a row!")
- end
- end
- last_win=n
- end
- end
- function eventTextAreaCallback(id,name,callback)
- if callback == "show_menu" then
- ui.addTextArea(299,"<p align='center'><a href='event:hide_menu'><font size='18'>Menu",name,365,376,70,24,0x000001,0x000001,0.75,true)
- ui.addTextArea(298,"<p align='center'><a href='event:help'>Help</a> | <a href='event:profile'>Profile</a> | <a href='event:ranking'>Ranking</a>",name,300,350,200,20,0x000001,0x000001,0.80,true)
- end
- if callback == "hide_menu" then
- ui.addTextArea(299,"<p align='center'><a href='event:show_menu'><font size='18'>Menu",name,365,376,70,24,0x000001,0x000001,0.75,true)
- ui.removeTextArea(298,name)
- end
- if callback == "ranking" then
- eventChatCommand(name,"rank")
- end
- if callback == "profile" then
- tfm.exec.chatMessage("Use the !p command to view your profile and !p [user] to view the profile of specified user.",name)
- end
- if callback == "fechar" then
- for id=8000,8010 do
- ui.removeTextArea(id,name)
- end
- end
- if callback == "help" then
- eventChatCommand(name,"help")
- end
- if callback == "close" then
- for id=8000,8010 do
- ui.removeTextArea(id,name)
- ui.removeTextArea(6969+id,name)
- ui.removeTextArea(7979+id,name)
- end
- end
- if callback == "closep" then
- for id=9000,9010 do
- ui.removeTextArea(id,name)
- end
- end
- end
- function eventKeyboard(name,key,down,x,y)
- if enabled == true and powerups == true then
- if not tfm.get.room.playerList[name].isDead and data[name].p1 == false and data[name].p2 == false then
- if key == 112 and data[name].score >= 700 then
- data[name].p1=true
- data[name].score=data[name].score-700
- data[name].pcount=16
- tfm.exec.chatMessage("<J>"..name.." used the powerup Fast Spirits!")
- end
- if key == 113 and data[name].score >= 250 then
- data[name].p2=true
- data[name].score=data[name].score-250
- data[name].pcount=20
- tfm.exec.chatMessage("<J>"..name.." used the powerup Double Power!")
- end
- if key == 114 and data[name].score >= 550 then
- data[name].score=data[name].score-550
- tfm.exec.chatMessage("<J>"..name.." used the powerup Box Meteor!")
- for i=-6,19 do
- tfm.exec.addShamanObject(2,i*60,-1,0,0,0,false)
- end
- end
- if key == 115 and data[name].score >= 400 then
- data[name].score=data[name].score-400
- tfm.exec.chatMessage("<J>"..name.." used the powerup Night Mode!")
- ui.addTextArea(2571,"",nil,-800,-600,3000,3000,0x010101,0x010101,0.99,true)
- nightmode=true
- end
- if key == 116 and data[name].score >= 1000 then
- data[name].score=data[name].score-1000
- tfm.exec.chatMessage("<J>"..name.." used the powerup Mega Explosion!")
- for i=-4,12 do
- for j=-2,6 do
- tfm.exec.explosion(i*100,j*100,intensity,intensity*1.5,false)
- tfm.exec.displayParticle(10,i*100,j*100,0,0,0,0,nil)
- end
- end
- end
- end
- end
- end
- tfm.exec.newGame("#10")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement