Shoutbox

An idea for a script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: An idea for a script (/showthread.php?tid=66225)

An idea for a script by lu_benja on 09-14-2006 at 02:15 PM

A calculator... in the dialog chat..
we can share the actions that we do in the caculator and it has a tab here-


RE: An idea for a script by Matti on 09-14-2006 at 02:23 PM

Making a calculator isn't hard at all, since JScript already has very powerfull math functions. Buth adding a tab there, and make the tab work will be lots harder.

A way to do it, is to use child windows: one for the extra tab (like the timer in the Timezone script, but placed somewhere else) and one for an editing panel with a toolbar and a message box. It can be done that way, but I only wonder how the math formules will be displayed in the message box. :-/


RE: An idea for a script by alexp2_ad on 09-14-2006 at 02:25 PM

I liked the [calc] tag deAd had in a testing script he made... and never released. :(

I still use it. :P


RE: An idea for a script by Jimbo on 09-14-2006 at 02:41 PM

I don't know if this helps, but i found this on a website, maybe someone can convert it into plus scripting?

code:
<script language="JavaScript">
var m;
m = 0;
var i;
var mm;
function num ( i ) //delete the spaces here
{
var u = new String();
u = text3.value;
if (u == "=")
{
text1.value = text2.value = "";
text1.value = text1.value + i ;
text3.value = "";
return;
}
var s;
var l;
s = text1.value;
l = s.length;
if (l<10)
{
text1.value = text1.value  + i;
}
}
function point()
{
var i;
var s = new String();
s = text1.value;
i = s.indexOf(".");
var u = new String();
u = text3.value;
if (u == "=")
{
text1.value = text2.value = "";
text1.value = text1.value + "." ;
text3.value = "";
return;
}
if (i > -1)
{
return;
}
else
{
if (s.length<9)
{
s = s + ".";
text1.value = s;
}
}
}
var cho;
function act(cho)
{
var u = new String();
u = text3.value;
if (u == "")
{
text2.value = text1.value;
text1.value = "";
}
else
{
switch (u)
{
case "+" :
text2.value = (text2.value*1) + (text1.value*1);
text1.value = "";
break;
case "-" :
text2.value = (text2.value*1) - (text1.value*1);
text1.value = "";
break;
case "*" :
text2.value = (text2.value*1) * (text1.value*1);
text1.value = "";
break;
case "/" :
text2.value = (text2.value*1)/(text1.value*1);
text1.value = "";
break;
case "=" :
text2.value = text1.value;
text1.value = "";
break;
}
}
switch (cho)
{
case 1 :
text3.value = "+";
break;
case 2 :
text3.value = "-";
break;
case 3 :
text3.value = "*";
break;
case 4 :
text3.value = "/";
break;
}
}
function eq()
{
switch (text3.value)
{
case "+":
text2.value = (text2.value*1) + (text1.value*1);
text1.value = text2.value;
text2.value = "";
break;
case "-":
text2.value = (text2.value*1) - (text1.value*1);
text1.value = text2.value;
text2.value = "";
break;
case "*":
text2.value = (text2.value*1) * (text1.value*1);
text1.value = text2.value;
text2.value = "";
break;
case "/":
text2.value = (text2.value*1) / (text1.value*1);
text1.value = text2.value;
text2.value = "";
break;
}
text3.value = "=";
}
function clss()
{
text1.value = text2.value = text3.value = "";
m =0;
clear1.blur();
}
function initia()
{
text1.blur();
text2.blur();
}
function clearall()
{
text1.value = "";
}
function madd()
{
m = m + ((text1.value)*1);
text1.value = "";
text3.value = "";
}
function msub()
{
m = m - ((text1.value)*1);
text1.value = "";
text3.value = "";
}
function mrem()
{
if (m != 0)
{
text1.value = m;
text3.value = "";
}
}
function free()
{
if (mm != 1)
{
alert ('JavaScript disables this action!!');
}
}
function frees()
{
mm = 1;
}
function freed()
{
mm = 0;
}
</script>


RE: An idea for a script by Shondoit on 09-14-2006 at 03:39 PM

I could help with the tab...

And we could also make the calc on top of the textedit area...
Just like a real tab

(Only, I have the tabs on the right side of the convo ??)

-edit- @Mattike, what do you mean formulas? I think, he just means like the windows calc, that doesn't show any formulas either...


RE: An idea for a script by lu_benja on 09-14-2006 at 04:00 PM

so do you think it's posible? if it is I think that it will be very useful
for an example..
a lot of time friends wants me to help them in math and explane how I did it..
another idea is to add to the handwriting tab shapes like a circle or something
and if someone will succed to do a calc' maybe there is an option to upgrade it and add fractions (?) ..
anyway..  I think it's useful for everyone


RE: An idea for a script by Jimbo on 09-14-2006 at 04:17 PM

is it possilbe, but the question is, if anyone can be bothered to do it? LOL


RE: An idea for a script by Matti on 09-14-2006 at 04:29 PM

quote:
Originally posted by Shondoit
@Mattike, what do you mean formulas? I think, he just means like the windows calc, that doesn't show any formulas either...
Well, I think it would be nice to have exponents to be placed as superscript. But for simple math functions (+, -, *, /,...) a simple message box is indeed enough.
And a nice addition would be to place a custom toolbar above the original toolbar, since the real toolbar wouldn't work anyway. :P

The problems I think about:
  • How can the script see where the tab/box should be placed? Placing it vertically is easy with a bottom margin, but the user can hide the display pictures, making it harder to set the correct right margin.
  • What about resizing the text area? How would the box react on that?
  • How can you make it act as a real tab, like making the other tabs unselected? So it doesn't look like you don't have 2 tabs activated.
If there is a practical solution to fix these, I actually see this script become reality. :)
RE: An idea for a script by R4000 on 09-14-2006 at 05:07 PM

hehe, sorry if this sounds n00bish.

but id do some memory editing...

open up a memory editor or w/e (i used artmoney to play with this)
do a full scan to grab all data
switch the tab
and filter it based on 'CHANGED'
then just play with the values it finds, see if you can set the current tab to 0 or something...

just an idea


RE: An idea for a script by saralk on 09-14-2006 at 06:19 PM

What about a command like "/math 2 + 3" which would send "2 + 3 = 5"


RE: An idea for a script by Matti on 09-14-2006 at 06:48 PM

quote:
Originally posted by saralk
What about a command like "/math 2 + 3" which would send "2 + 3 = 5"
Yes, but I think a tab would look lots cooler. (H)
I would like to work on such script, when I'm on my own pc... :P
RE: An idea for a script by ForestPlus! on 09-14-2006 at 07:32 PM

Such script would be amazing.. and on the tabs where usually the emoticon wink nudge buttons ect would be nice to have the plus minus divide multiply ect.. buttons :P

[offtopic]Speaking of which, wouldn't it be funny if theres was a messenger minus! live:P [/offtopic]


RE: An idea for a script by Matti on 09-15-2006 at 07:34 AM

quote:
Originally posted by ForestPlus!
and on the tabs where usually the emoticon wink nudge buttons ect would be nice to have the plus minus divide multiply ect.. buttons :P
quote:
Originally posted by Mattike
...and one for an editing panel with a toolbar and a message box.
Already thought about that, yes it would be very cool. :)
[OFFTOPIC]
quote:
Originally posted by ForestPlus!
[offtopic]Speaking of which, wouldn't it be funny if theres was a messenger minus! live:P [/offtopic]
Since it would remove existing features, instead of adding new. ;)
[/OFFTOPIC]

RE: An idea for a script by CookieRevised on 09-15-2006 at 02:44 PM

quote:
Originally posted by saralk
What about a command like "/math 2 + 3" which would send "2 + 3 = 5"
Dead easy actually, all you need to do is to grab the command line parameter and let JScript evaluate it:
   return CommandParameter + " => " + eval(CommandParameter)


Attached is a full blown script which does exactly that.
Usage:
   /calc <math expression>

Examples:
   /calc (5+5)*8/20+3                   output: (5+5)*8/20+3 => 7
   /calc (5+5)==11                       output: (5+5)==11 => false
   /calc    5  <new line>  +     5         output: 5 + 5 => 10
   /calc 5///////5                          output: standard Plus! "invalid parameter" message box
   /calc                                      output: standard Plus! "no parameter" message box


it also gives an example in:
- how to split the command and parameter from eachother in a very easy way using 1 regular expression in 1 IF...THEN...ELSE function.
- how to show a standard Plus! error message, using Plus!'s own translations

see source for more info




RE: An idea for a script by Spunky on 09-15-2006 at 03:17 PM

Wow! I like :p Would be so much cooler if we could have a graphical calculator as well though :)