Very simple calc script

By Chainchomp on Sep 17, 2006

A very simple calculator script, just copy into your remotes and type @calc .

MUST be used for a bot, and can be used by anyone on the channel.

Only one line, so very easy to copy and paste to share.

;A very simple calculator script, just copy into your remotes and type @calc <sum>.
on *:TEXT:@calc *:#: msg $chan $nick $+ : The answer is $calc($2-)

Comments

Sign in to comment.
Chainchomp   -  Sep 18, 2006

Hey, take it easy, it was just a joke.

Your 5 year old nephew can script???

 Respond  
sean   -  Sep 18, 2006

@Chainchomp: Im not mocking you, just pointing out your \"flaws\". In addition: Just because something works, doesn\'t mean it\'s acceptable. If you post somethign here, your expecting review. In reviewing, people tend to be critically harsh; not \"mocking\". \"It works don\'t it? Be happy\", why should I be happy about something that:
1) is incomplete.
2) is unuseful to me
3) my 5 year old nephew could have scripted better.
Comment Rules:

Do not complain about your score.

Keep your language professional at all times.

Always be constructive.

If you can\'t take the critisim don\'t post; simple. Enough Said.

@Noutrious: No need for \'halt\' in your post. Also, your if statement has room for error (which defeats the purpose of \"error checking\"). In your statement, you only check for \'$2\' when there\'s a possibility that more characters could be involved

 Respond  
Noutrious   -  Sep 18, 2006

on *:TEXT:@calc:#:{
if ($2) && ($calc($2-)) {
.notice $nick $2- = $calc($2-)
halt
}
else {
.notice $nick Error, invalid syntax. (Example: 2 + 2 or 4 / 2)
halt
}
}

 Respond  
StanZ   -  Sep 18, 2006

Hum, too simple maybe :))

 Respond  
Chainchomp   -  Sep 18, 2006

Sean likes moking me :P
It works don\'t it? Be happy :D

 Respond  
sean   -  Sep 17, 2006

;A very simple calculator script, just copy into your remotes and type @calc .

Why would you $calc() the sum of something? Also, you have to take in consideration that some do not know the correct sytax, so error checking would be a must for something like this.

 Respond  
Chainchomp   -  Sep 17, 2006

Oops, forgot to mention that, comments please.

 Respond  
Ace99   -  Sep 17, 2006

Very simple and very useful...For those of you that don\'t know...

^ = Exponent
/ = Division

  • = Multiplication
  • = Addition
  • = Subtraction
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.