wanna program? here ill help you out.
heres what u gotta know.
i wont cover syntax because all programming languages have different syntax but they all have these base concepts. for my examples ill ill use python syntax because its good for noobs and it.
variables- like in algebra, they are just something that is meant to hold the data and input that they are assigned to be it through user input, default value, or a function that changes it.
example of assigning values to variables-
w = 1
x = 2.14
y = "dicks"
z = ['cocks','penises,'dongers','schlongs']
wait, why do all these look different? because they all have different data types. those types are, respectively-
integers: just a whole number with no decimal. just type the number, there's your integer.
floats: that's a number with decimals. could also be an integer value with a decimal like 1.0
strings: a string is just text that you read or write, you can't do math with it. this right here on this very post is a string. most languages have strings in double or single quotes.
arrays: it's a variable that contains a whole bunch of values. these can be iterated through and manipulated.
ok, onto the more spicy stuff. all those data types have functions that make them able to be manipulated. those functions are called the METHODS of a given data type.
and for most variables, especially integers, you can help set their values with operators. They operate on the value to set or change it.
examples-
( )
**
*
/
+
-
These just are the tip of the iceburg, they're the basic arithmetic operations of PEMDAS in order from top to bottom. There are many others and you should look into them.
but, why would you just assign a value to something and just use a method to change it? you could always just... assign the changed value as the original value. true. but what it if you'd only like to use a method under certain circumstances?
enter, if statements. an if statement looks like this-
if (some expression that can be checked for true or false):
(some block of code you want to do IF that expression is true, such as a method on a predefined variable.)
it's as simple as that. but what if you have multiple conditions with different levels of precedence?
if (most important condition):
(code)
else if (next most important condition):
(code)
else if (condition):
(code)
you get the point.
alternatively you could just do this if you just want it to do something if your statement is false-
if (condition):
(code)
else:
(code)
what if you have multiple conditions that you want to be true?
if (condition) and (condition):
(code)
what if you have several conditions that could be true?
if (condition) or (condition):
(code)
what if you want code to execute if something ISN'T true?
if not(condition):
(code)
These are the fundamental decision making structures in most programming languages.
What if you want code to go on forever?
use a while statement-
while (condition):
(code)
if you make your condition something that won't be made true, then that code will go on forever.
another kind of loop is an iterator. an iterator is a loop that will perform code for each value in an array in order. every language has its own type of iterator. in python it is very easy and looks like this-
array = [1,2,3,4,5,6,7,8,9]
for x in array:
(code)
this will go through the whole array and perform the code for each value in that array. in each iteration, x is the variable that represents the current value in the array that is being iterated through. you'd use this in the code block to change or manipulate that value.
and of course, none of this could be possible without functions. the form of a function most languages looks like:
(declaration keyword) functionname(argument, argument):
(some code that uses those arguments.)
return(whatever you want the function to spit out once this code is executed)
an argument is basically a variable in the function similar to algebra except that it can also be strings, arrays, and even other functions' return values.
a return value works like this- a function takes your arguments, does something with them, and then the return value is used to indicate what you want that function to give you once it's all done.
now, this last bit will definitely help you read code you see that you didn't write.
what if you wanted to have a whole bunch of statements of code that all are relavent to a specific task or purpose? you can create an object class. an object is said statements. a class is kind of like a template for that so that you can reuse them elsewhere and even rename them. a method is like a function in that object.
you'll often see methods or objects in a class be referenced with a period to indicate it. for example you could have a file called big, a class called dicks, and a variable in it called ass. you could set the class to be equal to your own name to simplify your own personal syntax. example-
import big (allows you access to content in the file called big)
dicksinmy = big.dicks()
anal = dicksinmy.ass
in this example, i set my objects name to equal a class aka its template. since this class was in the big file i imported it. then using the class and my object i accessed the ass variable. this may help you read code on for example, the SC source code better.
so, how did i i make SCraper? i imported a file called scrapy and with it i made a class object SCraper.
it made these things called http requests, in this case GET requests to SC, basically asking for the page. the GET requests yielded a response, which was basically the SC homepage's HTML and javascript, and that yields the graphical webpage you see. it then passes the html response to a parse function made to make more GET requests to the topic links and to the next page on the index until it fetched every topic on the site. then the response for topics themselves was passed to a function made to gleam the HTML for all of a given user's posts and compare them to a wordlist full of words made to promote doxxing. i selected this HTML with a language called xpath designed to select specific HTML bits.
my spambot SCpammer does this too except it logged mewhe in first with a POST request to the login and when it gets to topics it sent a POST request to make a post rather than collecting data.
i plan on making for bots for more.... fun purposes, soon. hope the guide helped.