It is currently Wed Nov 19, 2008 3:55 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: a little help :)
PostPosted: Fri Sep 07, 2007 8:47 am 
Offline

Joined: Fri Sep 07, 2007 8:43 am
Posts: 5
I have just a little problem during compilation:
I want use this script:

Code:
use uo;
use os;

program hulka(who);
var hp;
var dmg;
var none;
var malohp;
hp := getvital(who,"life");
dmg := RandomFloat(20);
none := (hp-1);
if (none>=dmg);
ApplyRawDamage(who,dmg);
elseif (none<dmg);
malohp := (hp-none);
ApplyRawDamage(who,malohp);
else
(hp=1);
continue
endif
endprogram

but ecompiler cant compile that becouse:

C:\pol\scripts>ecompile hulka.src
EScript Compiler v1.08
Copyright (C) 1994-2007 Eric N. Swanson

Compiling: C:\pol\scripts\hulka.src
Token '(' cannot follow token 'getvital'
Function getvital() is not defined.
Error compiling statement at C:\pol\scripts\hulka.src, Line 8
Error detected in program body.
Error occurred at C:\pol\scripts\hulka.src, Line 8
Execution aborted due to: Error compiling file


What iam doing wrong? Can anyone help me?


Last edited by Yerome on Sun Sep 09, 2007 12:23 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 07, 2007 9:54 am 
Offline
Distro Developer
User avatar

Joined: Sat Jul 28, 2007 4:37 pm
Posts: 27
Location: HellCat Realms
Perhaps... try making it CamelCased.

Code:
hp := GetVital(who,"life");


instead of

Code:
hp := getvital(who,"life");


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 07, 2007 10:15 am 
Offline

Joined: Tue Mar 20, 2007 7:17 am
Posts: 105
Location: Poland
if it`s pol097

use vitals; <- this is missing


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 07, 2007 10:17 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 225
If you are using POL 097, you need to use module vitals. GetVital() and some other functions were moved onto that.

Code:
use vitals;


Also notice that '=' is deprecated novadays, you must use ':=' or '=='.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 07, 2007 11:17 am 
Offline

Joined: Fri Sep 07, 2007 8:43 am
Posts: 5
thanks... iam just compile that but i have another problem... apply dmg on a player. its dont work...

I just trying to make a magic wand.. which give you a random dmg but never kill you, you must have at least 1hp...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 08, 2007 3:13 am 
Offline

Joined: Tue Mar 20, 2007 7:17 am
Posts: 105
Location: Poland
something like this?

Code:
use uo;
use vitals;

program wand(who)

    var dmg := Randomint(20);
    var Hp:=Cint(GetVital(who, "Life")/ 100);

    if(Hp-dmg<=0)
         dmg := Hp -1;
    endif

    ApplyRawDamage(who,dmg);

endprogram



Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 12:06 pm 
Offline

Joined: Fri Sep 07, 2007 8:43 am
Posts: 5
coltain wrote:
something like this?

Code:
use uo;
use vitals;

program wand(who)

    var dmg := Randomint(20);
    var Hp:=Cint(GetVital(who, "Life")/ 100);

    if(Hp-dmg<=0)
         dmg := Hp -1;
    endif

    ApplyRawDamage(who,dmg);

endprogram



Yes, something like that :)
THX you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl