Skip to content

updates key_script to store 5 key_holder(colorwise)#17

Open
guptaprakhariitr wants to merge 16 commits intomdgspace:masterfrom
guptaprakhariitr:master
Open

updates key_script to store 5 key_holder(colorwise)#17
guptaprakhariitr wants to merge 16 commits intomdgspace:masterfrom
guptaprakhariitr:master

Conversation

@guptaprakhariitr
Copy link
Copy Markdown
Member

No description provided.

Comment thread scripts/keys.coffee Outdated
Comment thread scripts/keys.coffee Outdated
Comment thread scripts/keys.coffee Outdated
@Arnesh07
Copy link
Copy Markdown
Member

LGTM! @aseem09 Please review this PR once. Also, @guptaprakhariitr commit name should always indicate what that commit does, not a generic name to all.

@guptaprakhariitr guptaprakhariitr changed the title Keys management based on 5 colors updates key_script to store 5 key_holder(colorwise) Feb 23, 2020
Comment thread scripts/keys.coffee Outdated
# Developer at SDSLabs (@sdslabs)
# Developer at SDSLabs (@sdslabs
# Edit:
# prakhar gupta
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment thread scripts/keys.coffee Outdated
robot.brain.set("keyRed",Key1)
Key1
keyBlue = ()->
Key1 = robot.brain.get("keyBlue") or ""
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

Comment thread scripts/keys.coffee
Comment thread scripts/keys.coffee Outdated
key_holder = keyBlue()
key_holder = user.name
robot.brain.set("keyBlue",key_holder)
else if keyname is 'Yellow'
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread scripts/keys.coffee Outdated
key_holder = keyYellow()
key_holder = user.name
robot.brain.set("keyYellow",key_holder)
else if keyname is 'Green'
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

Comment thread 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?"
Copy link
Copy Markdown
Contributor

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.

Comment thread scripts/keys.coffee Outdated


robot.respond /i have (a key|the key|key|keys)/i, (msg)->
#1this section belongs to "i have keys"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "#1", "#2" etc from the start of each comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aseem09 done

Comment thread 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"
Copy link
Copy Markdown
Contributor

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!

Comment thread scripts/keys.coffee Outdated
# Developer at SDSLabs (@sdslabs)
# Developer at SDSLabs (@sdslabs
# Edit:
# Prakhar Gupta at Mdg
Copy link
Copy Markdown
Contributor

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.

Comment thread 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"
Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants