Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --get winratio for each player
- --don't run this before you join a game or you'll flood
- add_hook("console","console", chat)
- add_hook("draw2d","draw2d", draw)
- add_hook("match_begin","new match", newmatch)
- toriStatus=""
- tSent=0
- uSent=0
- toriWR=0
- ukeWR=0
- winRatio=0
- tori = "isaac"
- uke = "isaac"
- --just shows the current variables at the top right. Mostly debugging right now
- function draw()
- --echo("Tori and Uke: ")
- --echo(tori)
- --echo(uke)
- set_color(1, 0, 0, 1);
- draw_right_text("tori: "..tori.." uke: "..uke.." TWR: "..toriWR.."UWR: "..ukeWR.." tSent: "..tSent.."uSent: "..uSent.."toriStatus: "..toriStatus, 250, 50);
- end
- --set everything to 0 and get the names of the players
- function newmatch()
- toriWR=0
- ukeWR=0
- winRatio=0
- tSent=0
- uSent=0
- toriStatus=""
- tori = get_player_info(0).name
- uke = get_player_info(1).name
- echo("Tori: "..tori.." Uke: "..uke)
- end
- function chat(text, type)
- --if it finds Ratio in the chat
- if string.find(text,"Ratio: ") then
- --get a sub string and convert it to a number
- i, j = string.find(text, "Ratio: ")
- winRatio = tonumber(string.sub(text,j+1,j+2))
- --if the status was for tori or for uke
- if toriStatus=="u" then
- ukeWR=winRatio
- elseif toriStatus=="t" then
- toriWR=winRatio
- end
- echo("ToriWR: "..toriWR.."UkeWR: "..ukeWR)
- else
- --echo("not found")
- end
- --if there's no tori or uke status then do /stats for them one at a time.
- if tSent==0 then
- tSent=1
- toriStatus="t"
- run_cmd("cp \nstats "..tori)
- elseif uSent==0 and toriWR>0 then
- uSent=1
- toriStatus="u"
- run_cmd("cp \nstats "..uke)
- end
- --echo("ToriWR: "..toriWR.."UkeWR: "..ukeWR)
- --echo("Tsent: "..tSent.." uSent: "..uSent)
- end
- echo("hello!!!?")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement