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
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.
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.
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 errori have no idea y, is that the way u were trying to explaining it or not?Code:Line 182: [Error] (12717:1): Type mismatch in script C:\Program Files
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;
There are currently 1 users browsing this thread. (0 members and 1 guests)