Results 1 to 7 of 7

Thread: radio buttons

  1. #1
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Unhappy radio buttons

    ok well i have radio buttons on my form and i have a start button so how do u make it so the script checks to see if radio button one was checked or if radio button 2 was checked?

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow. I am impressed to see such a new member using such advanced scripting concepts already

    I don't know too much about forms, but each button has a separate name. So you are trying to find out how to distinguish between two different radio buttons, then it would be just like distinguishing between 2 regular variables.

    If you were asking how to check if the boxes are checked or unchecked, do like:

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      RadioButtons: Array [0..1] of TRadioButton;

    begin
      if(RadioButtons[0].checked)then
        Writeln('Radio button number 1 is checked');
      if(RadioButtons[1].checked)then
        Writeln('Radio button number 2 is checked');
    end.

    Obviously this is not a full form so it will not work, but that is the basic idea on how to check if the radio buttons are checked or unchecked as far as I know.
    Last edited by JAD; 08-19-2009 at 12:21 PM.

  3. #3
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks ok well if this does not work it occured to me while thinking earlier today that i could do this:

    Code:
    Radiobutton.onclick := @radbut1;
    Code:
    procedure radbut1(forgot what goes here)
    begin
    rad := 1;
    or rad := 'rad1';
    end;
    Code:
    procedure startclick(again forgot)
    begin
    if rad := 1 then (or 'rad1';)
    begin
    (code)
    end esle
    begin
    (code)
    end;
    (possible another end;)
    yes I do forgot how many ends and the tobject thing witch is why I made lots of notes in my script. If it comes down to it I think I might redo my form and make it look a but better with a banner and such like the advanced forms I have seen in tuts but for now I want to see if my script will make it past its beta stage

  4. #4
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry for the double post but umm is it bad or dangerouse to have ur script press the home teleport then map walk to the area you do your autoing?

  5. #5
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by boredGamer View Post
    sorry for the double post but umm is it bad or dangerouse to have ur script press the home teleport then map walk to the area you do your autoing?
    Nope, unless you do it alot

    btw its "Procedure wat(Sender: TObject);
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  6. #6
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need the Sender.

    Code:
    Procedure radbut1(Sender: TObject);
    sorry for the double post but umm is it bad or dangerouse to have ur script press the home teleport then map walk to the area you do your autoing?
    It shouldn't be as long as your script can reach the place. But remember that the teleport can only be used once every 30 minutes.

    Edit: Noidea beat me.

  7. #7
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks just making sure i dont need to redo my script
    Last edited by boredGamer; 08-20-2009 at 09:19 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •