Ok.. where to begin...
Wrote this to improve !calc, a lot.
Now you can easily use the last calc, and also give calcs their own identifiers for later use.
!calc 5+5
sets default to 10
!calc +4
sets default to 14
!calc -2
sets default to 12
!calc 2he 890+40+50
sets "2he" to 980
!calc 2he +20
sets "2he" to 1000
!calc 2he+2
sets "default" to 1002
!calc
returns a list with all your identifiers and their numbers
!calcr 2he
deletes the 2he identifier
Bugs
There are some problems when using * and / without having used () around previous calculations.
(not fixed it mostly due to cosmetic reasons and low useage of * and /)
Rename the calc to php (obviously).
And I'm aware I'm not the best person to explain how stuff I write works...
Updates
Fixed a slight pgroup/tell bug