updates key_script to store 5 key_holder(colorwise)#17
updates key_script to store 5 key_holder(colorwise)#17guptaprakhariitr wants to merge 16 commits intomdgspace:masterfrom
Conversation
|
LGTM! @aseem09 Please review this PR once. Also, @guptaprakhariitr commit name should always indicate what that commit does, not a generic name to all. |
scripts/keys.coffee
Outdated
| # Developer at SDSLabs (@sdslabs) | ||
| # Developer at SDSLabs (@sdslabs | ||
| # Edit: | ||
| # prakhar gupta |
There was a problem hiding this comment.
It is a good practice to write the name in capitals
scripts/keys.coffee
Outdated
| robot.brain.set("keyRed",Key1) | ||
| Key1 | ||
| keyBlue = ()-> | ||
| Key1 = robot.brain.get("keyBlue") or "" |
scripts/keys.coffee
Outdated
| key_holder = keyBlue() | ||
| key_holder = user.name | ||
| robot.brain.set("keyBlue",key_holder) | ||
| else if keyname is 'Yellow' |
scripts/keys.coffee
Outdated
| key_holder = keyYellow() | ||
| key_holder = user.name | ||
| robot.brain.set("keyYellow",key_holder) | ||
| else if keyname is 'Green' |
scripts/keys.coffee
Outdated
| else if name is key_holder4 | ||
| key_holder4 = "" | ||
| robot.brain.set("keyGreen",key_holder4) | ||
| msg.send "Okay #{name} doesn't have Green keys. Who got the green keys then?" |
There was a problem hiding this comment.
There are a few letter case issues in the code. I am not going to pin point all of them. Go through the code once. G should be capital here. It is a good practice to follow the protocols of standard letter casing.
scripts/keys.coffee
Outdated
|
|
||
|
|
||
| robot.respond /i have (a key|the key|key|keys)/i, (msg)-> | ||
| #1this section belongs to "i have keys" |
scripts/keys.coffee
Outdated
| msg.send "I don't know anyone by the name #{othername}" | ||
| key_holder1 = null | ||
| robot.brain.set("keyRed",key_holder1) | ||
| keyname="Red" |
There was a problem hiding this comment.
Make it a habit of adding a space on both the sides of an operator. eg the = here. There are many such instances in the file which require corrections. Have a look!
scripts/keys.coffee
Outdated
| # Developer at SDSLabs (@sdslabs) | ||
| # Developer at SDSLabs (@sdslabs | ||
| # Edit: | ||
| # Prakhar Gupta at Mdg |
There was a problem hiding this comment.
Align your name correctly. You may want to copy the same format as that of the author above.
scripts/keys.coffee
Outdated
| key_holder1 = users.name | ||
| robot.brain.set("keyRed",key_holder1) | ||
| keyname="red" | ||
| else if name is key_holder2 and users.name is not "bro" |
There was a problem hiding this comment.
users.name is not "bro" instead of using this every time make a parent if-else statement which checks for this condition
No description provided.