I’m making bots in gimkit creative, I need some help

Gimkit creative :slight_smile:

Just wondering, how old are you?

1 Like

Me?

Yes, you. How old are you?

2 Likes

Old enough

Who is @sigma99?

ok thank you

when someone presses a button it will enable a barrier. the bot that is in a separate room will see the color and do a command. when a different barrier is activated, a different color will show, this makes the bot do a different command

my special man
back on topic

Very good! please Ellaborate .

do you understand python code? it is about to get very complicated

ok one sec

Uhhhhhh okay! :slight_smile:

there is a way but it’s complicated

1 Like

you don’t sound to certain. i will draw a photo:

so the bot will be in its own unreachable area. when the player clicks a button it will flash a color (barrier) and that will tell the bot to do a action (like play a f4rt sound)

code for this:

#note that this code does not do any commands and only sends signals to do so
#it has also not been tested so I wouldn't rely on it (but you could of just set the signals up wrong
import numpy as np 
import cv2 


# starts a video
webcam = cv2.VideoCapture(0) 

# just a loop
while(1): 
	
	# Reading the video to detect colors
	_, imageFrame = webcam.read() 

	
	# color space 
	hsvFrame = cv2.cvtColor(imageFrame, cv2.COLOR_BGR2HSV) 

	# sets a range for red color and 
	# define mask 
	red_lower = np.array([136, 87, 111], np.uint8) 
	red_upper = np.array([180, 255, 255], np.uint8) 
	red_mask = cv2.inRange(hsvFrame, red_lower, red_upper) 

	# Set range for green color and 
	# define mask 
	green_lower = np.array([25, 52, 72], np.uint8) 
	green_upper = np.array([102, 255, 255], np.uint8) 
	green_mask = cv2.inRange(hsvFrame, green_lower, green_upper) 

	# sets a range for blue color and 
	# define mask 
	blue_lower = np.array([94, 80, 2], np.uint8) 
	blue_upper = np.array([120, 255, 255], np.uint8) 
	blue_mask = cv2.inRange(hsvFrame, blue_lower, blue_upper) 
	
	# to detect only that particular color 
	kernel = np.ones((5, 5), "uint8") 
	
	# for red color 
	red_mask = cv2.dilate(red_mask, kernel) 
	res_red = cv2.bitwise_and(imageFrame, imageFrame, 
							mask = red_mask) 
	
	# for green color 
	green_mask = cv2.dilate(green_mask, kernel) 
	res_green = cv2.bitwise_and(imageFrame, imageFrame, 
								mask = green_mask) 
	
	# for blue color 
	blue_mask = cv2.dilate(blue_mask, kernel) 
	res_blue = cv2.bitwise_and(imageFrame, imageFrame, 
							mask = blue_mask) 

	# tracking the red color
	contours, hierarchy = cv2.findContours(red_mask, 
										cv2.RETR_TREE, 
										cv2.CHAIN_APPROX_SIMPLE) 
	
	for pic, contour in enumerate(contours): 
		area = cv2.contourArea(contour) 
		if(area > 300): 
			x, y, w, h = cv2.boundingRect(contour) 
			imageFrame = cv2.rectangle(imageFrame, (x, y), 
									(x + w, y + h), 
									(0, 0, 255), 2) 
			
			cv2.putText(imageFrame, "Red Colour", (x, y), 
						cv2.FONT_HERSHEY_SIMPLEX, 1.0, 
						(0, 0, 255))	 

	# tracking the green color
	contours, hierarchy = cv2.findContours(green_mask, 
										cv2.RETR_TREE, 
										cv2.CHAIN_APPROX_SIMPLE) 
	
	for pic, contour in enumerate(contours): 
		area = cv2.contourArea(contour) 
		if(area > 300): 
			x, y, w, h = cv2.boundingRect(contour) 
			imageFrame = cv2.rectangle(imageFrame, (x, y), 
									(x + w, y + h), 
									(0, 255, 0), 2) 
			
			cv2.putText(imageFrame, "Green Colour", (x, y), 
						cv2.FONT_HERSHEY_SIMPLEX, 
						1.0, (0, 255, 0)) 

	# tracking the blue color
	contours, hierarchy = cv2.findContours(blue_mask, 
										cv2.RETR_TREE, 
										cv2.CHAIN_APPROX_SIMPLE) 
	for pic, contour in enumerate(contours): 
		area = cv2.contourArea(contour) 
		if(area > 300): 
			x, y, w, h = cv2.boundingRect(contour) 
			imageFrame = cv2.rectangle(imageFrame, (x, y), 
									(x + w, y + h), 
									(255, 0, 0), 2) 
			
			cv2.putText(imageFrame, "Blue Colour", (x, y), 
						cv2.FONT_HERSHEY_SIMPLEX, 
						1.0, (255, 0, 0)) 
			
	# program termination 
	cv2.imshow("insert_name_here", imageFrame) 
	if cv2.waitKey(10) & 0xFF == ord('q'): 
		cap.release() 
		cv2.destroyAllWindows() 
		break

i think this could be put into help since it is gimkit related enough

To make auto name-checkers, and block players who have a certain name, use a block code if statement to check if “triggering player’s name” is equal to any blocked words.

Very simple.


How is this topic “technical”. Gimkit has built-in blocks for math and equations.


Maybe generative ai, and yes, it is very possible to make that in gkc. Either neural networks or generating based on probability, we could make engines for these in gkc.

The problem with this is that we have little to no resources to train these. In gkc, a block can hold only 75 pieces, and a text piece can hold only a few sentences. The best we can hope for would be far too memory consuming, and obviously not a good idea.


Basic devices that perform actions based on their surroundings? We already have many of those. Take my guide on a walking sentry. This is what the checker is for. And wires. And channels.


Hmm… so you want a bot to detect when a color is flashed, and act on whatever color is flashed? Why not wire the barrier to the trigger, barrier activated → trigger, and have the action there? Why overcomplicate things with a bot?

1 Like

What code language is that?

actually read other posts

1 Like

I did read other posts.

then why did you ask what code it was???

also are you going to use it or…?

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.