Discuss Scratch

MonkeyBean2
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Air_heads wrote:

ScratchTheCoder12345 wrote:

infintyrussia wrote:

nampinanathali wrote:

MonkeyBean2 wrote:

nampinanathali wrote:

infintyrussia wrote:

nampinanathali wrote:

infintyrussia_test wrote:

I was wonder on how I could make sure the requests that are being sent are real and not sent from a python console. By that, I mean people could send fake requests setting their cash to a big amount. I need to stop this somehow. I was thinking of getting a sha hasher 256 and having it make a different string every time but I am not sure how that would work.

Does anyone have any ideas?
add a secret key that only the client and your server know for each users
The thing is that Scratchathon uses this and I still cracked it to test if the system would work for me. I just went inside the project and got the key for me. Are there any other ways?

yes you can reset the secret keys everytime the green flag is clicked so if i go inside it's doesn't matter since the secret key is reset
fetching the project JSON will reveal the secret key.
no because the secret keys is randomly generated by the server and then sent to the client
How would that work? Couldn't the person fetch the key by clicking see inside?
No, you couldn't you have the secret key be changed every time?

Either way, they could still fetch it because there is a connection made between the client and the server, so there is really no 100% secure way to transmit data. There might be a way, but most likely not.
Okey, make a demo please, then we can try to break it and learn how to make it more secure, until it's foolproof.


9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5

infintyrussia
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

-FreeEngines- wrote:

infintyrussia_test wrote:

I was wonder on how I could make sure the requests that are being sent are real and not sent from a python console. By that, I mean people could send fake requests setting their cash to a big amount. I need to stop this somehow. I was thinking of getting a sha hasher 256 and having it make a different string every time but I am not sure how that would work.

Does anyone have any ideas?
you could use signing (this is a little more annoying but would work)/RSA encryption. basically, whenever your server sets a cloud variable to change money, another cloud variable would be set to message which would be decrypted using a public key on your server. The server itsself knows the private key aswell, (the message should for example be the current timestamp) and then anytime a variable is set, it checks wheter the encrypted message which is sent with is actually the transaction that is beeing done. if it is not correct, the transaction would be undone.

NOTE, this system only works in a scenario where you do a lot, like basically everything on the serverside that has to do with money. If someone buys something, you dont change his money, you send an request to the server indicating the person bought something and change the amount of money he has depending on that and send him this amount of money (and give him what he bought). you should, if someone stays on the project very long, refresh his money (send him a response of how much money he has)

Wait, doesn't scratchattach use all the cloud vars? This would probably work if I made my own thing.

nampinanathali
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

 Caught error in request 'searchusername': Expecting value: line 1 column 1 (char 0) 


can you help me



mom when look at my browser history
carter2210
Scratcher
97 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

I need help, im trying to add cloud requests but it won't seem to work.
The problem is it won't add the “pong” in the response list.
Here is the python code:
import scratchattach as scratch3

session = scratch3.login(“carter2210”, “YOU ARE NOT GETTING MEH PASWORD”)
conn = session.connect_cloud(project_id=“717546662”)

client = scratch3.CloudRequests(conn)

@client.request
def ping():
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project

@client.event
def on_ready():
print(“Request handler is ready”)

client.run()
I think it could be the “import scratchattach as scratch3” part but probably not IDK halp

Last edited by carter2210 (July 27, 2022 22:44:09)



ඞඞඞ
ඞඞඞඞඞ
ඞඞඞඞඞඞඞ
ඞඞඞඞඞඞ
ඞඞඞඞඞඞඞ
ඞඞඞ
ඞඞඞඞඞ
Mini Cremat Protec Siggy

Quote of the IDK : “average amount of variables in a griffpatch tutorial: 36895191265932178598217”
(Note: Quote of the IDK Changes Randomly, Hence the Name.)
This is my account on Scratch Stats if you want

OTHER ACCOUNTS: Roblox, Minecraft, Steam.

PEOPLE YOU SHOULD CHECK OUT: My little sister, some of my friends.

COOL PROJECTS I MADE/HELP MADE/CONTRIBUTED TO: (By @1000epicc) (By @flowers_girl_2255)
-FreeEngines-
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

DXStr1ke wrote:

brandontwinzone wrote:

Thanks for the package! I'll use it for my future python projects
Also, is it available on PyCharm? I don't have pip.
If you don't have pip/pypi, TMC also said he put it on GitHub, so yes, you can still use it if you don't have pip installed.
people do not understand.. pycharm is an editor, not a custom python installation
ScratchTheCoder12345
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

-FreeEngines- wrote:

DXStr1ke wrote:

brandontwinzone wrote:

Thanks for the package! I'll use it for my future python projects
Also, is it available on PyCharm? I don't have pip.
If you don't have pip/pypi, TMC also said he put it on GitHub, so yes, you can still use it if you don't have pip installed.
people do not understand.. pycharm is an editor, not a custom python installation
I know right. Python is an IDE NOT A “custom python installation”

Hello, I'm Brandon a Python developer who loves math and coding.
Feel free to message me with any questions
TheReal_BestGamer
Scratcher
28 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

[Removed - please don't quote the main post]
How are you able to connect to the Scratch servers? Don't they encrypt data or at least have very minimal protection against this?

Last edited by Harakou (July 30, 2022 16:36:49)

TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Update - v0.8.4

New features:

Cloud requests

- Get request metadata (requester, request timestamp) in your requests.
You can now use these functions in your requests:
client.get_requester() #Returns the user who sent the request
client.get_timestamp() #Returns the timestamp of the request
This can be useful to prevent cloud hacking.

- More new features in this new section of the documentation: https://github.com/TimMcCool/scratchattach#cloud-requests—advanced

Bug fixes:

- Cloud requests will no longer print out the word “respond” and the cloud logs

My profile / Mein Profil: @TimMcCool
Mast_Scratch
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

Update - v0.8.4

New features:

Cloud requests

- Get request metadata (requester, request timestamp) in your requests.
You can now use these functions in your requests:
client.get_requester() #Returns the user who sent the request
client.get_timestamp() #Returns the timestamp of the request
This can be useful to prevent cloud hacking.

- More new features in this new section of the documentation: https://github.com/TimMcCool/scratchattach#cloud-requests—advanced

Bug fixes:

- Cloud requests will no longer print out the word “respond” and the cloud logs

First one to see this post and :O niceeeeeee

I am Mast_Scratch. Join Rear OS!!!
MrCloudGame
Scratcher
66 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

Update - v0.8.4

New features:

Cloud requests

- Get request metadata (requester, request timestamp) in your requests.
You can now use these functions in your requests:
client.get_requester() #Returns the user who sent the request
client.get_timestamp() #Returns the timestamp of the request
This can be useful to prevent cloud hacking.

- More new features in this new section of the documentation: https://github.com/TimMcCool/scratchattach#cloud-requests—advanced

Bug fixes:

- Cloud requests will no longer print out the word “respond” and the cloud logs



nice

–Signature–



Follow me on my Profil if you want Profil (@MrCloudGame)




Mast_Scratch
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

ok why was this not acitve

I am Mast_Scratch. Join Rear OS!!!
Nigthmare_27
Scratcher
37 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

carter2210 wrote:

I need help, im trying to add cloud requests but it won't seem to work.
The problem is it won't add the “pong” in the response list.
Here is the python code:
import scratchattach as scratch3

session = scratch3.login(“carter2210”, “YOU ARE NOT GETTING MEH PASWORD”)
conn = session.connect_cloud(project_id=“717546662”)

client = scratch3.CloudRequests(conn)

@client.request
def ping():
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project

@client.event
def on_ready():
print(“Request handler is ready”)

client.run()
I think it could be the “import scratchattach as scratch3” part but probably not IDK halp
You have to delete the client.event() part, the “client” variable is defined for cloud requests, not for events.
lecxouroblox
Scratcher
32 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

My browser / operating system: Windows NT 10.0, Chrome 103.0.0.0, Flash 32.0 (release 0)
(ChromeOS sucks for personal things.)
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Update - v0.8.5

Improvements:
- Cloud Requests will now always print out the full exception if there is an error in a request
- Requests don't send anything back to the Scratch project if they return None

Last edited by TimMcCool (Aug. 3, 2022 23:10:20)


My profile / Mein Profil: @TimMcCool
Mast_Scratch
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TimMcCool wrote:

Update - v0.8.5

Improvements:
- Cloud Requests will now always print out the full exception if there is an error in a request
- Requests don't send anything back to the Scratch project if they return None

FIRST AGAIN AND WOW!!

I am Mast_Scratch. Join Rear OS!!!
infintyrussia
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Is it possible to reduce the amount of cloud vars scratchattach uses? Like leave 2 cloud vars for the server and then the rest are free for me to use.

-FreeEngines-
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

TheReal_BestGamer wrote:

[Removed - please don't quote the main post]
How are you able to connect to the Scratch servers? Don't they encrypt data or at least have very minimal protection against this?
how would they?
Like anytime you send a request to the servers, the encryption etc. would have to be done client sided, which means you can replicate it. what would encrypting do anyways? and how would they have protection
-FreeEngines-
Scratcher
100+ posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

infintyrussia wrote:

Is it possible to reduce the amount of cloud vars scratchattach uses? Like leave 2 cloud vars for the server and then the rest are free for me to use.
no, the only way you could do that is by modifying tims code rapidly.
GentleX
Scratcher
91 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Blackout32 wrote:

QuadCat wrote:

MonkeyBean2 wrote:

QuadCat wrote:

MonkeyBean2 wrote:

QuadCat wrote:

TimMcCool wrote:

-snipped-
I cannot install scratchattach. Can you please help? I tried every way you listed. Python just says that there is a syntax error. Or when I try putting this at the beginning of the code file:

“import os
os.system(”pip install scratchattach“)

import scratchattach as scratch3”

And then putting the code, python says:

“Traceback (most recent call last):
File ”C:\Users\*****\Downloads\install scratchattach.py“, line 4, in <module>
import scratchattach as scratch3
ModuleNotFoundError: No module named ‘scratchattach’”


Or if I try to type“pip install scratchattach”, I get:
SyntaxError: invalid syntax

Can you please help me install scratchattach?

(I am on python 3.10.2, by the way)
Thanks!
You're supposed to type
pip install scratchattach
in your terminal


Yes. I did! Everywhere possible: Python, IDLE, …..
Does not work.


Step #1: Open finder, and navigate to the applications folder.
Step #2: Locate the utilities folder in the applications folder.
Step #3: Click on the utilities folder.
Step #4: Find the app called “terminal”.
Step #5: If you failed to find the app called “terminal”, search for “terminal” in the search box
Step #6: Double-click on the app called “terminal”.
Step #7: Type `pip install scratchattach` and press enter
Step #8: If the previous command fails, run `pip3 install scratchattach` and press enter.

It should look something like this: (I had already installed it, so it will be a bit different)


Don't mind my slow typing - I am not sitting properly, in a chair

>>> pip install scratchattach
File “<stdin>”, line 1
pip install scratchattach
^^^^^^^
SyntaxError: invalid syntax


(((((((((((((((((((((((
Do you have pip installed?
He might not have pip

GentleX

“In a gentle way, you can shake the world.”

Mahatma Gandhi

fries09
Scratcher
54 posts

scratchattach - A Scratch API wrapper | v1.0 released (Python)

Make this for Brain(f-word)

Hello.
<[My brain cells] < [-100]>

Powered by DjangoBB

Standard | Mobile