Shoutbox

[Release] Live Poll v1.02 - 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: [Release] Live Poll v1.02 (/showthread.php?tid=68276)

[Release] Live Poll v1.02 by phalanxii on 11-11-2006 at 10:10 AM

As requested in [request] poll script:

12 November 2006
- Live Poll -
Version 1.02


Live Poll will create a poll for your personal message which can have as many options as you want. Your contacts can vote for the option they want by saying "!vote <option number>".

Features:

- Real-time poll in personal message
- Customizable poll question
- Customizable poll options
- Contacts can vote with messages

Usage:

- /poll <on|off>: Enable or disable the poll; if on|off is unspecified, the poll is toggled
- /pollQuestion <question>: Define the poll question
- /pollOption <option number> <option>: Define a poll option
- /pollClear <option number>: Clear the settings of the poll; if option number is specified, the option is removed
- /pollVote <option number>: Vote for a poll option
- /pollInfo: Send the poll information
- !vote <option number>: Vote for a poll option (for contacts)
- Commands are case-insensitive

Example:
code:
/pollQuestion What is your favourite colour?
/pollOption 1 Red
/pollOption 2 Green
/pollOption 3 Blue
/pollOption 4 Yellow
/poll on
/pollVote 3
The resulting personal message would read "What is your favourite colour? | 1: Red (0 votes), 2: Green (0 votes), 3: Blue (1 votes), 4: Yellow (0 votes) | Say "!vote <option number>" to vote!".


Comments, feedback and suggestions welcome. No GUI at the moment.

Special thanks to Jimbodude for the About Window.
RE: [Release] Live Poll by Jimbo on 11-11-2006 at 10:17 AM

Yay! thanks so much phlanxii. Ive been waiting ages for this.
Maybe you could add somehting like "!vote <<word here. rather than option muber>>


RE: [Release] Live Poll by elektra on 11-11-2006 at 10:19 AM

Wow im gonna download this
*quacky downloads this cool script
as soon as i sign in and i will report bugs staight here :)


RE: [Release] Live Poll by NanaFreak on 11-11-2006 at 10:22 AM

nice script... i had a quick look through the .js file and it looks like you know your stuff

atleast now JimboDude wont keep requesting this :P

quote:
Originally posted by phalanxii
2: Greem
i think you spelt that wrong :P
RE: [Release] Live Poll by Jimbo on 11-11-2006 at 10:24 AM

Meh, im bored. If you want, i can make an about window for you? yes?


RE: [Release] Live Poll by elektra on 11-11-2006 at 10:33 AM

A suggestion, how about a command the sends the poll to the contact instead of writing it out all the time.
maybe a /pollsend or /pollinfo


RE: RE: [Release] Live Poll by phalanxii on 11-11-2006 at 10:37 AM

quote:
Originally posted by Jimbodude
Maybe you could add somehting like "!vote <<word here. rather than option muber>>

This is possible, but there may be problems if you have numbers for your options (like "How old are you? | 1: 15, 2: 16, 3: 17..."). What should take priority? Option number or option word?
quote:
Originally posted by Jimbodude
Meh, im bored. If you want, i can make an about window for you? yes?

Yeah, sure. If you really want to.
quote:
Originally posted by quacky
A suggestion, how about a command the sends the poll to the contact instead of writing it out all the time.
maybe a /pollsend or /pollinfo

Alright, I'll put that in the next release.

PS. Fixed the typo. :P
RE: [Release] Live Poll by Felu on 11-11-2006 at 10:49 AM

Nice but this ain't reliable [Image: xso_sad.gif]. Any contact should not be able to vote more than once [Image: xso_undecided.gif]. Also the script shouldn't remove your current PSM unless the poll is ON on Messenger Initialize.


RE: RE: [Release] Live Poll by phalanxii on 11-11-2006 at 10:57 AM

quote:
Originally posted by -!Felu!-
Nice but this ain't reliable [Image: xso_sad.gif]. Any contact should not be able to vote more than once [Image: xso_undecided.gif].
Yeah, I was aware of that problem, but I wasn't exactly sure how to keep track of who had voted and who hadn't. Perhaps the registry/user IDs?
quote:
Originally posted by -!Felu!-
Also the script shouldn't remove your current PSM unless the poll is ON on Messenger Initialize.

Can you explain that with more detail? :S Not sure what the problem is... The current PSM seems to work fine for me.
RE: RE: RE: [Release] Live Poll by NanaFreak on 11-11-2006 at 11:10 AM

quote:
Originally posted by phalanxii
quote:
Originally posted by -!Felu!-
Nice but this ain't reliable [Image: xso_sad.gif]. Any contact should not be able to vote more than once [Image: xso_undecided.gif].
Yeah, I was aware of that problem, but I wasn't exactly sure how to keep track of who had voted and who hadn't. Perhaps the registry/user IDs?

you could use a registry and the contacts email. i think tat would be the best option

quote:
Originally posted by phalanxii
quote:
Originally posted by -!Felu!-
Also the script shouldn't remove your current PSM unless the poll is ON on Messenger Initialize.

Can you explain that with more detail? :S Not sure what the problem is... The current PSM seems to work fine for me.


when we install the script it takes our current PSM away and leave a blank one ( i know i had one because i had just changed it )

i hope this stuff helps
RE: [Release] Live Poll by Felu on 11-11-2006 at 11:11 AM

quote:
Originally posted by phalanxii
Can you explain that with more detail? (Smilie) Not sure what the problem is... The current PSM seems to work fine for me.
Erm... Disable Poll, Keep some random PSM, Exit Messenger, Open Messenger, Signin.
quote:
Originally posted by phalanxii
Yeah, I was aware of that problem, but I wasn't exactly sure how to keep track of who had voted and who hadn't. Perhaps the registry/user IDs?
Yes you'll have to use the registry and an array. Add me to wlm(address in profile) for more help [Image: msn_happy.gif].
RE: [Release] Live Poll by Jimbo on 11-11-2006 at 11:17 AM

Ive made the about window. Hope you like it.
EDIT:for some weird reason the attachment didn't work so heres the code:

code:
<?xml version="1.0" encoding="UTF-16"?>
    <GlobalColors>
        <GlobalColor Id="green"><Red>80</Red><Green>200</Green><Blue>65</Blue><Alpha>220</Alpha></GlobalColor>
        <GlobalColor Id="white"><Red>255</Red><Green>255</Green><Blue>255</Blue><Alpha>255</Alpha></GlobalColor>
        <GlobalColor Id="black"><Red>0</Red><Green>0</Green><Blue>0</Blue><Alpha>255</Alpha></GlobalColor>
        <GlobalColor Id="grey"><Red>223</Red><Green>223</Green><Blue>223</Blue><Alpha>255</Alpha></GlobalColor>
        <GlobalColor Id="bg"><BaseColor><Saturation>2</Saturation><Brightness>0.6</Brightness><Transparency>82</Transparency></BaseColor></GlobalColor>
        <GlobalColor Id="ref"><BaseColor><Saturation>2.5</Saturation><Brightness>0.8</Brightness><Transparency>220</Transparency></BaseColor></GlobalColor>
    </GlobalColors>

    <Window Id="WndAbout" Version="1">
        <Attributes>
            <Caption>Live poll-About</Caption>
        </Attributes>   
        <Position Width="300" Height="200"/>
        <Elements>
            <Element xsi:type="FigureElement" Id="RectTopGradient">
                <Position Top="0" Left="1" Width="900" Height="29"/>
                <Figure><RoundRect><Radius>5</Radius></RoundRect></Figure>
                <Fill>
                    <LinearGradient Angle="90">
                    <Color1><BaseColor><Transparency>0</Transparency></BaseColor></Color1>
                    <Color2><BaseColor><Transparency>100</Transparency></BaseColor></Color2>
                    </LinearGradient>
                </Fill>
            </Element>       
            <Element xsi:type="FigureElement" Id="FigRectDev">
                <Position Top="57" Left="190" Height="45" Width="97"/>
                <Figure><RoundRect><Radius>3</Radius></RoundRect></Figure>
                <Border>
                    <Color><GlobalColor>bg</GlobalColor></Color>
                </Border>
                <Fill>
                    <PlainColor><Red>255</Red><Green>255</Green><Blue>255</Blue><Alpha>170</Alpha></PlainColor>
                </Fill>
            </Element>
            <Element xsi:type="FigureElement" Id="FigRectInfo">
                <Position Top="110" Left="190" Height="24" Width="97"/>
                <Figure><RoundRect><Radius>3</Radius></RoundRect></Figure>
                <Border>
                    <Color><GlobalColor>bg</GlobalColor></Color>
                </Border>
                <Fill>
                    <PlainColor><Red>255</Red><Green>255</Green><Blue>255</Blue><Alpha>170</Alpha></PlainColor>
                </Fill>
            </Element>
            <Element xsi:type="ImageElement" Id="imgLogo">
                <Position Top="3" Left="3" />
                <Image>
                    <Name>logo</Name>
                </Image>
            </Element>
            <Element xsi:type="LineElement" Id="LnTopSep">
                <Position Top="52" Left="65" Width="120" Height="0">
                    <Anchor Horizontal="LeftRightFixed"/>
                </Position>
                <Size>1</Size>
                <Color><Red>195</Red><Green>195</Green><Blue>195</Blue></Color>
            </Element>
            <Element xsi:type="LineElement" Id="LnBottomSep">
                <Position Top="125" Left="5" Width="175" Height="0">
                    <Anchor Horizontal="LeftRightFixed"/>
                </Position>
                <Size>1</Size>
                <Color><Red>195</Red><Green>195</Green><Blue>195</Blue></Color>
            </Element>
            <Element xsi:type="ImageElement" Id="Bg">
                <Position Top="1" Left="90"/>
                <Image><Name>windowbkg</Name></Image>
            </Element>           
        </Elements>
        <DialogTmpl>
            <BottomBar Style="Plain">
                <RightControls>
                    <Control xsi:type="ButtonControl" Id="BtnCancel">
                        <Position Left="0" Top="0" Width="50"/>
                        <Caption>Close</Caption>
                    </Control>
                </RightControls>
            </BottomBar>
        </DialogTmpl>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblTitle">
                <Position Top="15" Left="60" Width="160" Height="16" />
                <Caption>Live poll</Caption>
                <Transparency>200</Transparency>
                <Font><Bold>True</Bold><Size>16</Size></Font>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>
            <Control xsi:type="StaticControl" Id="lblVersion">
                <Position Top="32" Width="150" Left="65"/>
                <Caption>Version : 1</Caption>
                <Transparency>130</Transparency>
                <Font><Bold>true</Bold><Size>7</Size></Font>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>
            <Control xsi:type="StaticControl" Id="lblDeveloper">
                <Position Top="59" Left="195" Width="230" Height="10" />
                <Caption>Developer : </Caption>
                <Font><Bold>True</Bold></Font>
            </Control>       
            <Control xsi:type="LinkControl" Id="creator">
                <Position Top="69" Left="195" Width="50" Height="10" />
                <Attributes>
                    <Underline>WhenHot</Underline>
                </Attributes>
                <Caption>Phalanxii</Caption>
            </Control>
            <Control xsi:type="StaticControl" Id="lblMoreInfo">
                <Position Top="112" Left="195" Width="230" Height="10" />
                <Caption>More Info : </Caption>
                <Font><Bold>True</Bold></Font>
            </Control>
            <Control xsi:type="LinkControl" Id="lnkWebsite">
                <Position Top="122" Left="195" Width="50" Height="10" />
                <Attributes>
                    <Underline>WhenHot</Underline>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
                <Caption>Website</Caption>
            </Control>               
            <Control xsi:type="StaticControl" Id="lblAbout">
                <Position Top="56" Left="5" Width="180" Height="60" />
                <Caption>Live poll is a simple script that allows you to show a poll in your PSM.</Caption>
            </Control>
           
            <Control xsi:type="StaticControl" Id="lblSpecialThanks">
                <Position Top="90" Left="5" Width="150" Height="10" />
                <Caption>Special Thanks to :</Caption>
                <Font><Bold>True</Bold></Font>
            </Control>
            <Control xsi:type="StaticControl" Id="lblSpecialThanks2">
                <Position Top="110" Left="5" Width="230" Height="10" />
                <Caption>Jimbodude for creating the about window</Caption>
            </Control>
           
        </Controls>
       
    </Window>
   
</Interfaces>


RE: [Release] Live Poll by phalanxii on 11-11-2006 at 11:47 AM

Ok, I've made a small update now. This new version should fix the personal message bug, and also only allow contacts to vote once.

It's pretty late at the moment, so I'm going to go to bed. I'll work on this later (although I have exams coming up soon). See ya all later!

Btw, thanks for the window, Jimbodude. (Y)


RE: [Release] Live Poll by Jimbo on 11-11-2006 at 11:48 AM

quote:
Originally posted by phalanxii

Btw, thanks for the window, Jimbodude. (Y)
no probs

RE: [Release] Live Poll v1.01 by creepy675298 on 11-11-2006 at 06:33 PM

Where are the results? I have no PSM

And could you make it so it's in the list when you click the lil msg plus icon.

Got PSM working


RE: [Release] Live Poll v1.01 by Jimbo on 11-11-2006 at 06:57 PM

quote:
Originally posted by creepy675298


And could you make it so it's in the list when you click the lil msg plus icon.


Is not in the list because there isn't a GUI yet, when he adds my about window(hopefully:p) it will be there

RE: [Release] Live Poll v1.01 by creepy675298 on 11-11-2006 at 07:41 PM

Doesn't work with some of my contacts


RE: [Release] Live Poll v1.01 by Plan-1130 on 11-11-2006 at 08:53 PM

Damn, I'm too late I see, i got loads and loads of tests last 2 weeks, I was working on it, but you got one already, and it's good, guess my work is over now :(

Anyway, very nice, congrats (Y):)


RE: [Release] Live Poll v1.01 by RaPLeX on 11-11-2006 at 09:14 PM

Its doesnt worked for me. :/


RE: [Release] Live Poll v1.02 by phalanxii on 11-12-2006 at 02:33 AM

Here's another update to the script. This time I've cleaned up the "already voted" check thing, and also fixed the PSM bug. Jimbodude's About Window is also included, and I'll probably leave it there until I have time to make a GUI.

For all people having problems, can you explain what happens or how to reproduce the bug? Make sure you have typed "/poll on" to a contact.

Also, if you get the PSM bug on the first startup, it's because you need to remove the previous version first.


RE: [Release] Live Poll v1.02 by laurenz on 11-12-2006 at 01:26 PM

Is it possible to have a popup where you have to enter your poll question and answers?
Because typing it isn't really user-friendly, but a popup where you only need to fill in some forms is very user-friendly!