-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updates key_script to store 5 key_holder(colorwise) #17
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good practice to write the name in capitals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
scripts/keys.coffee
Outdated
robot.brain.set("keyRed",Key1) | ||
Key1 | ||
keyBlue = ()-> | ||
Key1 = robot.brain.get("keyBlue") or "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be Key2? @Arnesh07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
scripts/keys.coffee
Outdated
key_holder = keyBlue() | ||
key_holder = user.name | ||
robot.brain.set("keyBlue",key_holder) | ||
else if keyname is 'Yellow' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y
should be in small case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
scripts/keys.coffee
Outdated
key_holder = keyYellow() | ||
key_holder = user.name | ||
robot.brain.set("keyYellow",key_holder) | ||
else if keyname is 'Green' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G
should be in small case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aseem09 done
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.