Results 1 to 8 of 8

Thread: forms trouble

  1. #1
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default forms trouble

    i have made a form for my autofighter and i am having a really hard time creating a startclick procedure that begins the script, i have tried a couple of ways and i end up with all sorts of errors i was wondering if anyone could help



  2. #2
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    anyone i reallh hate to double post but i have been working on this startbuttonn proc for hours now



  3. #3
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Aaaaa I dont COMPLETLY know, but it is something like
    Startbotton := @Nameofprocedure

    procedure (Startbotton : Tbotton)

    something along those lines. Idk I'm doing all my form stuff on the weekend with a good srl member friend of mine.

  4. #4
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by osmm View Post
    Aaaaa I dont COMPLETLY know, but it is something like
    Startbotton := @Nameofprocedure

    procedure (Startbotton : Tbotton)

    something along those lines. Idk I'm doing all my form stuff on the weekend with a good srl member friend of mine.

    yea thats how you do it but the hard bit is making the script recognise the stuff entered in the forms as stuff needed to run the script, hptoeat monster color etc



  5. #5
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OHHHH your talking like if you got Enter Your Username in the form and you want it to be like player 1. Well I mean that same thing, except for other things like eating food and stuff. Yea thats really easy. Ummm I don't really got time right now to tell you how. Actually thursday is the earlyist time I can get on msn, but that would be too late. Ummm basicly like just do if lets say "hp to eat food at" is a catagory in your forms and Hp_For_Food is the constant in your script.

    Do
    Hp_For_Food := Edit1.Text;

    Edit1.Test would be the box on the forms they type the hp at. idk if that helps or anything.

  6. #6
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    yeah i think that actually does, il give that a go and let u know how it goes

    ohhhh theres so many variables i have to add now

    thanks

    EDIT:heres my start click procedure

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin
         userange := rangebox.text
         mode := fightmodecb.text           // line 182
         evenskills := evenskillbox.text
         arrowtype := arrowbox.text
         foodcolor := foodcolorbutton.caption
         mcolor1 := colorbutton1.caption
         mcolor2 := colorbutton2.caption
         mcolor3 := colobutton3.caption
         eathp := hpedit.text
         monster := monstnameedit.text
         lblUser.Caption := IntToStr(cUser);
         edNick.Text := Players[cUser].Nick;
         edUser.Text := Players[cUser].Name;
         edPass.Text := Players[cUser].Pass;
         if (Players[cUser].Active) then
            cbActive.Text := 'True'
         else
         cbActive.Text := 'False';
         MyAutofighter.ModalResult:= mrOk;
    end;

    and everything is declared in variables

    SCAR Code:
    var
       //script Variables
       m, monsters, Att,Str,Def, x, y, ArrowGround, ArrowInv, ArrowInvent, mode, mcolor1, mcolor2, mcolor3, foodcolor, eathp :Integer;
       Goal, username, password, nickname, monster, arrowtype : String;
       active, evenskills, userange : boolean;

    but i get this error
    Code:
    Line 182: [Error] (12717:1): Type mismatch in script C:\Program Files
    i have no idea y, is that the way u were trying to explaining it or not?



  7. #7
    Join Date
    Jun 2007
    Posts
    152
    Mentioned
    4 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Bonfield View Post
    yeah i think that actually does, il give that a go and let u know how it goes

    ohhhh theres so many variables i have to add now

    thanks

    EDIT:heres my start click procedure

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin
         userange := rangebox.text
         mode := fightmodecb.text           // line 182
         evenskills := evenskillbox.text
         arrowtype := arrowbox.text
         foodcolor := foodcolorbutton.caption
         mcolor1 := colorbutton1.caption
         mcolor2 := colorbutton2.caption
         mcolor3 := colobutton3.caption
         eathp := hpedit.text
         monster := monstnameedit.text
         lblUser.Caption := IntToStr(cUser);
         edNick.Text := Players[cUser].Nick;
         edUser.Text := Players[cUser].Name;
         edPass.Text := Players[cUser].Pass;
         if (Players[cUser].Active) then
            cbActive.Text := 'True'
         else
         cbActive.Text := 'False';
         MyAutofighter.ModalResult:= mrOk;
    end;

    and everything is declared in variables

    SCAR Code:
    var
       //script Variables
       m, monsters, Att,Str,Def, x, y, ArrowGround, ArrowInv, ArrowInvent, mode, mcolor1, mcolor2, mcolor3, foodcolor, eathp :Integer;
       Goal, username, password, nickname, monster, arrowtype : String;
       active, evenskills, userange : boolean;

    but i get this error
    Code:
    Line 182: [Error] (12717:1): Type mismatch in script C:\Program Files
    i have no idea y, is that the way u were trying to explaining it or not?
    It's because a textbox value is a string, so you need to convert the string to an integer.
    You might also have to do it for boolean?

    I think using it like this should help... let me know if it still comes back with errors.

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin
         userange := StrToBool(rangebox.text);
         mode := StrToInt(fightmodecb.text);          
         evenskills := StrToBool(evenskillbox.text);
         arrowtype := arrowbox.text;
         foodcolor := StrToInt(foodcolorbutton.caption);
         mcolor1 := StrToInt(colorbutton1.caption);
         mcolor2 := StrToInt(colorbutton2.caption);
         mcolor3 := StrToInt(colobutton3.caption);
         eathp := StrToInt(hpedit.text);
         monster := monstnameedit.text;
         lblUser.Caption := IntToStr(cUser);
         edNick.Text := Players[cUser].Nick;
         edUser.Text := Players[cUser].Name;
         edPass.Text := Players[cUser].Pass;
         if (Players[cUser].Active) then
            cbActive.Text := 'True'
         else
         cbActive.Text := 'False';
         MyAutofighter.ModalResult:= mrOk;
    end;

  8. #8
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    garrett thanks for that it fixed it, i didnt even think that that i had to convert strins to integers etc



Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Always trouble
    By BlueDraGoN777 in forum OSR Help
    Replies: 3
    Last Post: 01-08-2008, 07:19 PM
  2. Trouble with Forms (invalid parameters)
    By Mamby in forum OSR Help
    Replies: 2
    Last Post: 10-25-2007, 12:00 AM
  3. trouble!
    By s1cky in forum OSR Help
    Replies: 1
    Last Post: 10-08-2007, 12:47 AM
  4. trouble with srl
    By wesleyar in forum OSR Help
    Replies: 4
    Last Post: 06-02-2007, 04:28 AM
  5. having a bit of trouble
    By XcanadamanX in forum OSR Help
    Replies: 14
    Last Post: 01-30-2007, 10:00 PM

Posting Permissions

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