Garry's Mod

Garry's Mod

42 ratings
Basic Advanced Calculator by RandomTNT (Abandoned)
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun
File Size
Posted
Updated
53.216 KB
11 Jun, 2017 @ 1:44am
23 Aug, 2020 @ 12:04am
11 Change Notes ( view )

Subscribe to download
Basic Advanced Calculator by RandomTNT (Abandoned)

Description
New functions:

Integral("var","str",a,b,n)
where var is the variable to respect, str being the Lua string to evaluate, a for min, b for max and n for strips.
Example: Integral("X","math.abs(X^2+4*X)",1,6,4)

Graph("var","str",min,max)
where var is the variable to change, str being the Lua string to evaluate, min and max for min-x and max-x, respectively.

This project is now dead until more ideas arrive to my head permanently. I'd rather make a sequel rather than try to untangle old spaghetti code.

-------

A simple project that turned unnecessarily complex by my own desire to program stuff.

It was supposed to be just a basic calculator for my programming needs, like calculating the base-1.1 log of 10^6, until it got complex, up to the point where it can now manipulate vectors. Why I did this to myself is still a rather unanswered question...

It functions about the same as your standard scientific calculator, with a few benefits:
- way more variables, from A-Z.
- number rounding, up to a certain number of digits, number flooring and ceiling.
- highly customizable colours and buttons.
- slight amount of string and table manipulation, alongside addtional vector and logic processing.
- clientside RunString function. Removed after pictures were taken.

However, due to the lack of my programming skills, it comes with a couple of caveats:
- not all functions on the scientific calculator are implemented.
- variable values need to be saved with SavVars to be stored between sessions.
- the rootX,Y function needs to be typed as "root(X,Y)" for "X root Y".
- the factorial function needs to be typed as "fact(n)" for "n!".
- the equals sign should only be used inside tables, use Store to store objects into variables.
- bracket auto-correction only works for brackets, not square brackets nor quotation marks.
- auto-correction fails sometimes, use NoAuto to disable/enable it.
- fails to identify sin(180 degrees) as 0.
- uses Simpson's Rule to estimate integrals, and could therefore be wrong.
- only single-letter variables can be stored properly. Variables with more than one letter involved are only local to that session, and might overwrite something on the client if a similarly named variable exists.

Simply open your Context Menu (default C) and click on the 'Calculator' icon, or type 'advcalc' in console to open it.



Please send me any suggestions to improve the UI. Any other suggestions/bug reports are also welcome, but don't expect me to perform and/or read all of them, as I am a really slow coder.
15 Comments
McFeddle 2 Dec, 2022 @ 7:23pm 
Hello. This helped me pass school.
gm_flatgrass 24 May, 2019 @ 1:46pm 
i dont know XD
i try
Piengineer12  [author] 23 May, 2019 @ 5:43am 
And... How is that related to this?
gm_flatgrass 18 May, 2019 @ 2:52pm 
/\
l l
\/
l this is the gballons there ruiling steam bc they never get use
Piengineer12  [author] 12 Apr, 2019 @ 8:29pm 
The 2nd argument requires a Lua string. This addon is quite old so I don't know if I can fix it.
TromboneBoi9 12 Apr, 2019 @ 7:58pm 
The graph doesn't work, maybe I don't get it.
IntellectualPotato 18 Feb, 2019 @ 4:11pm 
hmmm..."basic advanced" seems legit
[G-Pro] F0x 6 Feb, 2019 @ 8:57am 
Awesome, numpad support would be great !
Cheese Gaming 21 Jul, 2018 @ 10:37am 
awesome:steamhappy:
Gigsuki浪人 3 Jul, 2018 @ 6:11am 
I don't think "Basic" and "Advanced" can be used in the same sentence