Closed Arinerron closed 8 years ago
I'll see what I can do here...
@MooShoe Thanks a lot! I can't figure out what I did wrong...
btw what ide / plugins are you using? I'm not to familiar with java with git.
@MooShoe I use Eclipse Mars and add the apache-httpclient libraries in. (I just imported everything in from Eclipse to Git.)
I didn't even have to import anything. :) Every library you added is all ready referenced.
:D
Is it just me or does it take FOREVER to load files and run the program?
Sorry, but just you... When I click it, it runs right away... BTW, are you still having issues with logging in? If so, do you know what line number the error is coming from? :)
I'll test this on Eclipse
It was coming from the line that threw the error... (Success!=0 then throw log in error) It was because you can only log into the same account once per computer.
About my programs speed, it takes about 5 seconds to log in. (Is that normal) It can't even finish the program, I suspect it's egit's fault.
Do you mind pasting the error (and of course you can snip out sensitive info)?
I don't have the error, I could try to pull it up again.
I removed eGit, it works nicely.
Hey - did you forget to add Scratch.cloud before the variable? The variable needs to have the symbol for it to work. I'm not on my computer with eclipse right now so I can't test it, I will though.
@MooShoe I don't think so; What I did was
And they both printed the same value and didn't throw an exception, so I know the variable name isn't the problem...
Wut? The variables name is Scratch.cloud + name, the value is just a number. Do you still have your code?
@MooShoe
This code is in a function that throws Exception
by the way, so no try/catch is needed.
ScratchSession session = Scratch.createSession("arinerron", "<password snipped>");
ScratchCloudSession cloudSession = session.getCloudSession(103969700);
String variable = Scratch.CLOUD + " test";
System.out.println("before: " + cloudSession.get(variable)); // get
cloudSession.set(variable, "10"); // set
System.out.println("after: " + cloudSession.get(variable)); // get
No Exceptions or anything, but 'before' and 'after' are the same value.
Update: I just found out that it doesn't send a handshake to the server when it connects. This may be the problem, I'm writing a new function for it now!
Also, I just realized a have a while true loop in the constructor. I wonder why that is there :P
wat rly
Finally got it to work. The problem was partially the wrong encoding (ISO_8859_1, it should be UTF-8), but mostly that the index for the substring method had one too many, I don't know how I didn't find that out before. :)
The file that contains the cloud data libraries it here > https://github.com/Arinerron/ScratchAPI/blob/master/src/edu/mit/scratch/ScratchCloudSession.java