Homework 1
Perl programming
- TA bot release and
Homework 1 Perl programming - TA bot release and demo attention - - PowerPoint PPT Presentation
Homework 1 Perl programming - TA bot release and demo attention Irc bot fighting screen shot TAs bot Usage: perl referee.pl YOUR_NICK_NAME IDENTIFY_PASSWD TESTING_CHANNEL This bot Should be a channel operator maintain channel
Usage: perl referee.pl YOUR_NICK_NAME IDENTIFY_PASSWD TESTING_CHANNEL This bot
Should be a channel operator maintain channel member list Decide fighting pair, and send ‘FIGHT’ msg
<@MCBSD> MCBSD2: FIGHT MCBSD3 1377 <@MCBSD> MCBSD3: FIGHT MCBSD2 63933
Kick loser and re-schedule winner
If u want to observe the fighting process
Add a normal user nick to: my @Operator = ($Nick, “XXX”);
Register ur own channel. Be careful start with double ‘#’ /msg ChanServ register ##XXXX Set channel operator, and auto-get Op after identifying and auto-login channel /msg ChanServ access ##XXXX add XXXX +voOtsriRfA
Be sure u receive ur and ur opponent’s fighting msg: MCBSD2: FIGHT MCBSD3 1377 MCBSD3: FIGHT MCBSD2 63933 Save ur opponent name, And ur and opponet’s random seed
※ seed will save as string in ur program
Hash string compare Hex char. is bigger than opponet?
Opponent’s is bigger five times mine is bigger five times
random seed Generate 絕招, and attack ur opponent: < MCBSD2> MCBSD3: MCBSD2下賤地blabla.... receive attack from ur opponent: < MCBSD3> MCBSD2: MCBSD3科科地blabla.... Encode and hash both attack: xxEncode = encode_base64(xxAttack ^ xxSeed) xxHash = md5_hex(xxencode ) My energy -1. My energy is 0?
Opponent’s energy -1 Opponent’s energy is 0?
* Me LOSER * Me WINNER
yes yes no no
If ur channel has unusual behavior…the admin is coming and “cares” for u…
Don’t use “bot海戰術” to test ur bot utility… and be as minimal testing as u can
Irc bot:
TA will ask u and check ur program, be sure
Fight with TA’s bot under same referee bot
Apache log analyser
Show ur result on browser
If TA’s bot discover someone can fight with u
u will receive msg from TA’s bot:
<@TABOT> ME: FIGHT OPPONENT $Seed # $Seed is a random number provide by TA’s bot # $Seed is a random number provide by TA’s bot
Apache log analyser calculate:
top 10: daily burning hour、user page popularity、file
downloading popularity