Discuss Scratch

TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

What was the issue? Was it the User-Agent or the default username?

Random Project

spamton.gif





























DUNGEON_EXPLORATION_03_02_23_01
COMPILED VERSION FOR HIGHER SPEED
NeonCoderFish
Scratcher
39 posts

scratchattach - A Scratch API wrapper (Python)

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.
i dont either, i would like to know
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

Why doesn't ‘pip’ and ‘pip3’ run in Command and Terminal?
TheMobileGames
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

justablock wrote:

GUYS I FOUND 24/7 FREE HOSTING NOT BANNED BY SCRATCH!!! YT VIDEO: https://www.youtube.com/watch?v=tyGwGSrujV4
It didn’t work for me like I said on your server earlier.

—————————— —————————— —————————— —————————— ——————————
A way to make any game easily mobile (no remixing needed): https://scratch.mit.edu/discuss/topic/733837
My mobile engine (use to add buttons/controls to a game): https://scratch.mit.edu/projects/778848092/
—————————— —————————— —————————— —————————— ——————————
TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

(#2364)
Why doesn't ‘pip’ and ‘pip3’ run in Command and Terminal?
try ‘python -m pip …’

Random Project

spamton.gif





























DUNGEON_EXPLORATION_03_02_23_01
COMPILED VERSION FOR HIGHER SPEED
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

TurboWarp's new guidelines for bots

About a week ago, TurboWarp started enforcing the User-Agent requirement for bots. This means:

  • If you're using the latest version of scratchattach (v1.7.2) you don't have to do anything - however, if you're using an older version prior to 1.6.4 you'll need to update to continue setting and getting TurboWarp cloud variables.

  • TurboWarp now also asks you to provide information about you and your project when connecting to their cloud server. In particular, they would like you to provide the purpose of your bot and identify yourself by giving a way you can be contacted. Since v1.7.0 this is possible with scratchattach using these keyword arguments:
    conn = scratch3.connect_tw_cloud(purpose="(optional) your use case", contact="(optional) your Scratch account or other contact info")
    
    The arguments are optional atm (you can leave them out), but they help TurboWarp to understand what you are using their service for
  • TurboWarp may also block bots that cause excessive traffic. Only if these bots provided their contact information, TurboWarp will contact them before blocking them.

Am I at the risk of being blocked when using TwCloudRequests?

No, you're safe. scratchattach's TwCloudRequests only create two connections to TurboWarp's websocket.
If you're using a version prior to 1.7.2 or enabled no_packet_loss, then TwCloudRequests create more connections tho (3 connections + another connection every time a request is received).

Therefore I recommend updating scratchattach and disabling no_packet_loss.

What should I avoid?

NEVER use the scratch3.get_tw_var and scratch3.get_tw_cloud functions in a loop. These functions create a new connection every time they are called which causes lots of spam on TurboWarp's server. If you need to continously get the value of a cloud variable, use TwCloudEvents instead (https://github.com/TimMcCool/scratchattach/wiki#cloud-events ).

Last edited by TimMcCool (April 20, 2024 01:55:42)


Developer of scratchattach, the most popular Python Scratch API wrapper
dynamicsofscratch
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

TimMcCool wrote:

(#2367)
TurboWarp's new guidelines for bots

About a week ago, TurboWarp started enforcing the User-Agent requirement for bots. This means:

  • If you're using the latest version of scratchattach (v1.7.2) you don't have to do anything - however, if you're using an older version prior to 1.6.4 you'll need to update to continue setting and getting TurboWarp cloud variables.

  • TurboWarp now also asks you to provide information about you and your project when connecting to their cloud server. In particular, they would like you to provide the purpose of your bot and identify yourself by giving a way you can be contacted. Since v1.7.0 this is possible with scratchattach using these keyword arguments:
    conn = scratch3.connect_tw_cloud(purpose="(optional) your use case", contact="(optional) your Scratch account or other contact info")
    
    The arguments are optional atm (you can leave them out), but they help TurboWarp to understand what you are using their service for
  • TurboWarp may also block bots that cause excessive traffic. Only if these bots provided their contact information, TurboWarp will contact them before blocking them.

Am I at the risk of being blocked when using TwCloudRequests?

No, you're safe. scratchattach's TwCloudRequests only create two connections to TurboWarp's websocket.
If you're using a version prior to 1.7.2 or enabled no_packet_loss, then TwCloudRequests create more connections tho (3 connections + another connection every time a request is received).

Therefore I recommend updating scratchattach and disabling no_packet_loss.

What should I avoid?

NEVER use the scratch3.get_tw_var and scratch3.get_tw_cloud functions in a loop. These functions create a new connection every time they are called which causes lots of spam on TurboWarp's server. If you need to continously get the value of a cloud variable, use TwCloudEvents instead (https://github.com/TimMcCool/scratchattach/wiki#cloud-events ).
Oh well. Spamming TW's servers is bad so I understand why they did this.

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

Why does PowerShell deny ScratchAttach access?
dynamicsofscratch
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

(#2369)
Why does PowerShell deny ScratchAttach access?
?what
maybe something related to security

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

First, it said pip use not recognized, and then it starts saying pip is not reconginzed as a file or path. Maybe it's because I'm usinng PowerShell 5.1, not the newest version, PowerShell 7.0
ShadowMilo
Scratcher
13 posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

First, it said pip use not recognized, and then it starts saying pip is not reconginzed as a file or path. Maybe it's because I'm usinng PowerShell 5.1, not the newest version, PowerShell 7.0
You need to use Command Prompt, not PowerShell
dynamicsofscratch
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

(#2371)
First, it said pip use not recognized, and then it starts saying pip is not reconginzed as a file or path. Maybe it's because I'm usinng PowerShell 5.1, not the newest version, PowerShell 7.0
you need to use command prompt/terminal. not powershell

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

ShadowMilo wrote:

(#2372)

FishHoue wrote:

First, it said pip use not recognized, and then it starts saying pip is not reconginzed as a file or path. Maybe it's because I'm usinng PowerShell 5.1, not the newest version, PowerShell 7.0
You need to use Command Prompt, not PowerShell
PowerShell is a superset of cmd.exe afaik

Last edited by TheCommCraft (April 20, 2024 14:06:11)


Random Project

spamton.gif





























DUNGEON_EXPLORATION_03_02_23_01
COMPILED VERSION FOR HIGHER SPEED
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

But Command Prompt and Terminal (which is powershell, jsut in a three in one format) do the same thing.
TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

(#2371)
First, it said pip use not recognized, and then it starts saying pip is not reconginzed as a file or path. Maybe it's because I'm usinng PowerShell 5.1, not the newest version, PowerShell 7.0
try “python.exe -m pip”

Random Project

spamton.gif





























DUNGEON_EXPLORATION_03_02_23_01
COMPILED VERSION FOR HIGHER SPEED
TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

If you don't have pip installed then try executing this python file: https://bootstrap.pypa.io/get-pip.py

Random Project

spamton.gif





























DUNGEON_EXPLORATION_03_02_23_01
COMPILED VERSION FOR HIGHER SPEED
dynamicsofscratch
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

(#2375)
But Command Prompt and Terminal (which is powershell, jsut in a three in one format) do the same thing.
just do it i mean. do you not have vscode terminal (in-built) or command prompt?

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

VS Code is NOT in built with Asus VivoBook E14s (which is what I have), instead it has every basic to medium Microaft app ranges, not addiotnal apps, like Power Automate, VS Code, Power Apps and other additions (which I can add in minutes).
dynamicsofscratch
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

(#2379)
VS Code is NOT in built with Asus VivoBook E14s (which is what I have), instead it has every basic to medium Microaft app ranges, not addiotnal apps, like Power Automate, VS Code, Power Apps and other additions (which I can add in minutes).
press windows key+r and type in cmd to run command prompt and type in pip install scratchattach

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.


Regards
dynamicsofscratch

Anything above that grey line is a signature!
Also, anything can be put in your signature, (also referred as a siggy) including ads but! You cannot do anything else that violates the community guidelines as, you will be reported and you could be banned/muted.
Computer enthusiast, coder, designer and a offline veteran.
700th post
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

dynamicsofscratch wrote:

(#2379)
press windows key+r and type in cmd to run command prompt and type in pip install scratchattach
It does the same THING: ‘pip’ is not recognized as an internal or external command,
operable program or batch file.

Last edited by FishHoue (April 21, 2024 10:33:49)

Powered by DjangoBB