a little help :)

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Yerome
New User
Posts: 5
Joined: Fri Sep 07, 2007 8:43 am

a little help :)

Post by Yerome »

I have just a little problem during compilation:
I want use this script:

Code: Select all

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.
User avatar
AxelDominatoR
New User
Posts: 27
Joined: Sat Jul 28, 2007 4:37 pm

Post by AxelDominatoR »

Perhaps... try making it CamelCased.

Code: Select all

hp := GetVital(who,"life");
instead of

Code: Select all

hp := getvital(who,"life"); 
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am

Post by coltain »

if it`s pol097

use vitals; <- this is missing
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Post by ncrsn »

If you are using POL 097, you need to use module vitals. GetVital() and some other functions were moved onto that.

Code: Select all

use vitals;
Also notice that '=' is deprecated novadays, you must use ':=' or '=='.
Yerome
New User
Posts: 5
Joined: Fri Sep 07, 2007 8:43 am

Post by Yerome »

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...
coltain
Grandmaster Poster
Posts: 159
Joined: Tue Mar 20, 2007 7:17 am

Post by coltain »

something like this?

Code: Select all

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

Yerome
New User
Posts: 5
Joined: Fri Sep 07, 2007 8:43 am

Post by Yerome »

coltain wrote:something like this?

Code: Select all

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.
Post Reply