Providing any credentials in plain text in your code is not reasonable, to say at least. It would be great to mask this data somehow — or better store it in a safe place and retrieve it when necessary without revealing it.
G1ANT.Robot provides such a safe storage for all sensitive information: Credential Container is a tool for entering and storing data that shouldn’t be visible to everyone, who has an access to a robot script.
Credential Containerfrom the
ContainerName:keyformat — for example, you can add
gmail:passwordkeys and their values to be used by the script from the previous lessons.
Now you can retrieve the information stored in the Credential Container using the
♥credential special variable and a key as an index:
♥credential⟦gmail:login⟧will return the value of the
gmail:loginkey — your Gmail login
♥credential⟦gmail:password⟧will return the value of the
gmail:passwordkey — your Gmail password
Time to alter the script to use these credentials:
♥login = ♥credential⟦gmail:login⟧ ♥password = ♥credential⟦gmail:password⟧ mail.imap imap.gmail.com login ♥login password ♥password sincedate ♥date onlyunreadmessages true ignorecertificateerrors true result ♥list foreach ♥element in ♥list dialog ♥element⟦content⟧ end
Alternatively, you can delete the first two lines altogether and insert both
♥credential variables directly into the
mail.imap command, replacing the
♥login and the
Next lesson: how to cheat in games :).