 |
 |
 |
 |
| Author |
Message |
Danielle
Joined: 07 Feb 2006 Posts: 97 Location: Pittsburgh, Pennsylvania
|
Posted: Mon Jul 03, 2006 6:54 pm Post subject: POL Module Updater |
|
|
This program will update your POL scripts and includes to ensure that they are using the correct modules for the version of POL you are using. Useful if you are upgrading to POL 97 or just want to make sure your scripts are accurate.
Includes support for:
- POL 95
- POL 96
- POL 97
- 07-28 core
- 08-30 core
- 09-16 core
- 10-18 core
- ...and future versions. Just add the newly added/moved/changed function to the appropriate INI file in the appropriate section. It's pretty self-explanatory once you look at the INI files. You don't have to wait for me to update the program -which probably won't happen until 97 is finalized.
Note: If you have more than one space between the function name and the opening parenthesis, the function will not be recognized. Some examples, a dash denotes the space(s):
- "Function(...)" -- OK
- "Function-(...)" -- OK
- "Function--(...)" -- NOT OK!!
- "Function---(...)" -- NOT OK!!
[EDIT] The download has been updated to version 1.0.2.0 -- See below post for details![/EDIT]
| Description: |
POL Module Updater setup.exe program
(zipped because .exe is not allowed) |
|
 Download |
| Filename: |
setup.zip |
| Filesize: |
120.63 KB |
| Downloaded: |
204 Time(s) |
Last edited by Danielle on Thu Jan 18, 2007 1:53 am; edited 5 times in total |
|
 |
|
|
 |
 |
|
 |
 |
| Author |
Message |
Danielle
Joined: 07 Feb 2006 Posts: 97 Location: Pittsburgh, Pennsylvania
|
Posted: Tue Jul 18, 2006 10:55 pm Post subject: |
|
|
Aside from your second issue (more on that below), both the other issues have been fixed. The download in the post above has been updated to version 1.0.1.0
The changelog:
| Quote: | POL Module Updater 1.0.1.0 -- Tuesday, July, 18, 2006
Changed: The program will now ignore commented text. This includes both line-level comments and block-level comments.
Fixed: The characters "à, è, é, ì, ò, ù" are now properly recognised and preserved.
Fixed: The program wasn't performing a case-insensitive search. |
I could not reproduce the sleep issue. It worked perfectly for me. It could be releated to the case-sensitive bug.. were you using perhaps "Sleep", versus "sleep"? If so, it's fixed.
|
|
 |
|
|
 |
 |
|
 |
 |
| Author |
Message |
Lagoon
Joined: 05 Mar 2006 Posts: 118 Location: Italy
|
Posted: Wed Jul 19, 2006 4:17 am Post subject: |
|
|
| Danielle wrote: | Aside from your second issue (more on that below), both the other issues have been fixed. The download in the post above has been updated to version 1.0.1.0
The changelog:
| Quote: | POL Module Updater 1.0.1.0 -- Tuesday, July, 18, 2006
Changed: The program will now ignore commented text. This includes both line-level comments and block-level comments.
Fixed: The characters "à, è, é, ì, ò, ù" are now properly recognised and preserved.
Fixed: The program wasn't performing a case-insensitive search. |
I could not reproduce the sleep issue. It worked perfectly for me. It could be releated to the case-sensitive bug.. were you using perhaps "Sleep", versus "sleep"? If so, it's fixed. |
Yes, I think it's because some scripts had Sleep() instead of sleep()
Thanx for the update ^_^
|
|
 |
|
|
 |
 |
|
 |
 |
| Author |
Message |
qrak
Joined: 05 Feb 2006 Posts: 160 Location: Poland
|
Posted: Thu Oct 19, 2006 12:13 pm Post subject: |
|
|
Still something is wrong. I've tried to convert pol96 modules to pol97 modules.
1. you forgot about start_script in pol97.ini
2. why that tool puts in my NPCKeeper.src seven modules: npc, polsys, math, util, basic, uo and cfgfile if only uo.em and os.em are needed?
3. Im using FindAccount in one script and updater don't see it and im getting error from the compiler.
4. One more example:
| Code: |
use os;
use npc;
use basic;
program CanInsert(who, backpack, movetype, inserttype, item, existing_stack, amt_to_add);
set_critical(1);
if(inserttype != INSERT_ADD_ITEM)
return 0;
endif
return 0;
set_critical(0);
endprogram
|
Why npc module is here? Why uo.em isn't here if supposed to be?
I can give lot of more examples.
|
|
 |
|
|
 |
 |
| Author |
Message |
Danielle
Joined: 07 Feb 2006 Posts: 97 Location: Pittsburgh, Pennsylvania
|
Posted: Fri Oct 20, 2006 8:26 am Post subject: |
|
|
| Quote: | | 1. you forgot about start_script in pol97.ini |
Feel free to add it. I did and i'll update the download soon. Thats why I used ini files.. so if pol is updated and new functions are added or old ones are moved the program could be quickly updated without me.
| Quote: | | 2. why that tool puts in my NPCKeeper.src seven modules: npc, polsys, math, util, basic, uo and cfgfile if only uo.em and os.em are needed? |
I don't know without seeing the script.
| Quote: | | 3. Im using FindAccount in one script and updater don't see it and im getting error from the compiler. |
I don't know without seeing the script, also whats the compiler error?
| Quote: | | Why npc module is here? Why uo.em isn't here if supposed to be? |
It's possible it picked up on the word "move" which is an npc.em function. It shouldn't do that though. Additionally, there are no uo.em functions in that script, so why do you think it should be in there?
|
|
 |
|
|
 |
 |
| Author |
Message |
qrak
Joined: 05 Feb 2006 Posts: 160 Location: Poland
|
Posted: Fri Oct 20, 2006 10:07 am Post subject: |
|
|
1. ok
2. NPCKeeper.src:
| Code: |
use npc;
use polsys;
use math;
use util;
use basic;
use uo;
use cfgfile;
include "include/startEqp";
include "include/attributes";
include "include/vetement";
include "include/randName";
include "include/client";
var pncfg := ReadConfigFile("npcdesc");
var equipt;
program npckeep(who)
SetObjProperty(who, "AiSerial", cint(who.serial));
var colors := pncfg[who.npctemplate].colors;
if(colors)
colors := SplitWords(colors);
var clr := Cint(colors[RandomInt(Len(colors)) + 1]);
who.color := clr;
SetObjProperty(who, "Color", clr);
endif
if(who.name["<escortee>"])
var ttitle := "";
case(randomint(20) + 1)
0: ttitle := " the townsperson"; equipt := "peasant1";
1: ttitle := " the townsperson"; equipt := "peasant1";
2: ttitle := " the townsperson"; equipt := "peasant1";
3: ttitle := " the townsperson"; equipt := "peasant1";
4: ttitle := " the townsperson"; equipt := "peasant1";
5: ttitle := " the townsperson"; equipt := "peasant1";
6: ttitle := " the townsperson"; equipt := "peasant1";
7: ttitle := ""; equipt := "peasant1";
8: ttitle := ""; equipt := "peasant1";
9: ttitle := ""; equipt := "peasant1";
10: ttitle := ""; equipt := "peasant1";
11: ttitle := ""; equipt := "peasant1";
12: ttitle := ""; equipt := "peasant1";
13: ttitle := " the mage"; equipt := "Mage";
14: ttitle := " the mage"; equipt := "Mage";
15: ttitle := " the mage"; equipt := "Mage";
16: ttitle := " the seeker of adventure"; equipt := "seeker";
17: ttitle := " the seeker of adventure"; equipt := "seeker";
18: ttitle := " the seeker of adventure"; equipt := "seeker";
19: ttitle := " the noble"; equipt := "peasant2";
20: ttitle := " the noble"; equipt := "peasant2";
endcase
pickdestination(who, equipt);
case(randomint(2))
0: who.graphic := 0x190;
who.gender := 0;
equipt := equipt + "M";
1: who.graphic := 0x191;
who.gender := 1;
equipt := equipt + "F";
endcase
SetObjProperty(who, "Graphic", cint(who.graphic));
SetName(who, RandomName(who));
SetName(who, who.name + ttitle);
if(equipt)
Habille(who, equipt);
EraseObjProperty(who, "Equipt");
var lewtgroup := pncfg[who.npctemplate].lootgroup;
if(lewtgroup)
MakeLoot(who, cint(lewtgroup));
endif
endif
elseif(who.name["<employee>"])
var cost := 0;
var ttitle := "";
case(randomint(15) + 1)
0: ttitle := " the fighter"; equipt := "Fighter1"; cost := 40;
1: ttitle := " the fighter"; equipt := "Fighter1"; cost := 40;
2: ttitle := " the thief"; equipt := "Thief"; cost := 50;
3: ttitle := " the thief"; equipt := "Thief"; cost := 50;
4: ttitle := " the mage"; equipt := "Mage"; cost := 70;
5: ttitle := " the mage"; equipt := "Mage"; cost := 70;
6: ttitle := " the paladin"; equipt := "Paladin"; cost := 80;
7: ttitle := " the paladin"; equipt := "Paladin"; cost := 80;
8: ttitle := " the fighter"; equipt := "Fighter2"; cost := 40;
9: ttitle := " the fighter"; equipt := "Fighter2"; cost := 40;
10: ttitle := " the fighter"; equipt := "Fighter3"; cost := 40;
11: ttitle := " the fighter"; equipt := "Fighter3"; cost := 40;
12: ttitle := " the fighter"; equipt := "Fighter4"; cost := 40;
13: ttitle := " the fighter"; equipt := "Fighter4"; cost := 40;
14: ttitle := " the beggar"; equipt := "Beggar"; cost := 30;
15: ttitle := " the beggar"; equipt := "Beggar"; cost := 30;
endcase
SetObjProperty(who, "MerchantType", equipt);
SetObjProperty(who, "HireCost", cint(cost));
Adjustment(who, equipt);
case(randomint(2))
0: who.graphic := 0x190;
who.gender := 0;
equipt := equipt + "M";
1: who.graphic := 0x191;
who.gender := 1;
equipt := equipt + "F";
endcase
SetObjProperty(who, "Graphic", cint(who.graphic));
SetName(who, RandomName(who));
SetName(who, who.name + ttitle);
pncfg := ReadConfigFile("npcdesc");
if(equipt)
Habille(who, equipt);
EraseObjProperty(who, "Equipt");
var lewtgroup := pncfg[who.npctemplate].lootgroup;
if(lewtgroup)
MakeLoot(who, cint(lewtgroup));
endif
endif
else
pncfg := ReadConfigFile("npcdesc");
equipt := GetObjProperty(who, "Equipt");
var plec := GetObjProperty(who, "plec");
if(equipt)
if(who.graphic == 0x190)
if(plec)
case(plec)
"M": who.graphic := 0x190;
who.gender := 0;
equipt := equipt + "M";
"F": who.graphic := 0x191;
who.gender := 1;
equipt := equipt + "F";
endcase
else
case(randomint(2))
0: who.graphic := 0x190;
who.gender := 0;
equipt := equipt + "M";
1: who.graphic := 0x191;
who.gender := 1;
equipt := equipt + "F";
endcase
endif
endif
SetObjProperty(who, "Graphic", cint(who.graphic));
Habille(who, equipt);
EraseObjProperty(who, "Equipt");
var lewtgroup := pncfg[who.npctemplate].lootgroup;
if(lewtgroup)
MakeLoot(who, cint(lewtgroup));
endif
endif
if(Cint(GetObjProperty(who, "rideable")))
if(Cint(!GetObjProperty(who, "Decay")))
SetObjProperty(who, "Decay", ReadGameClock());
endif
endif
if(who.name["<random>"])
SetName(who, RandomName(who));
if(pncfg[who.npctemplate].title)
var title := randomint(20);
var ttitle := "";
case(title)
0: ttitle := "";
1: ttitle := " the townsperson";
2: ttitle := " the farmer";
3: ttitle := " the sailor";
4: ttitle := " the drunkard";
5: ttitle := " the wanderer";
6: ttitle := " the villager";
7: ttitle := " the gypsie";
8: ttitle := " the vagabond";
9: ttitle := " the laborer";
default: ttitle := "";
endcase
SetName(who, who.name + ttitle);
endif
elseif(who.name["<balron>"])
case(randomint(3) + 1)
1: SetName(who, "Potepiony Demon");
2: SetName(who, "Zniwiarz Dusz");
3: SetName(who, "Lord Zniszczenia");
endcase
//
// WOW GWYRM NAMES
elseif(who.name["<gwyrm>"])
case(randomint(3)+1)
1: SetName(who, "Gwareous Wielki");
2: SetName(who, "Erstatesorus Wielki");
3: SetName(who, "Antero Wielki");
endcase
//
// wow! new dragon names! H!O!T!
elseif(who.name["<dragon>"])
case(randomint(7) +1)
1: SetName(who, "Sergto-nen");
2: SetName(who, "Aresto-loferin");
3: SetName(who, "Gernerlofiterofis");
4: SetName(who, "Sunnero-is de Va");
5: SetName(who, "El Supbero'd Armad");
6: SetName(who, "Rtyios");
7: SetName(who, "Gawelsorofis");
endcase
endif
endif
if(pncfg[who.npctemplate].ammotype)
var ammotype := pncfg[who.npctemplate].ammotype;
if(ammotype)
var ammoamount := pncfg[who.npctemplate].ammoamount;
if(!ammoamount)
ammoamount := 30;
endif
var theammo := CreateItemInBackpack(who, ammotype, ammoamount);
if(theammo.amount > ammoamount)
SubtractAmount(theammo, (theammo.amount - ammoamount));
endif
endif
endif
//moved out so all templates can use this
if(pncfg[who.npctemplate].colorrange)
var parms := splitwords(pncfg[who.npctemplate].colorrange);
who.color := randomint(Cint(parms[2]) - Cint(parms[1]))+Cint(parms[1]);
endif
if(pncfg[who.npctemplate].mount)
var mymount := CreateItemAtLocation(263,623,-1,0xf021,1, _DEFAULT_REALM);
var mountparms := splitwords(pncfg[who.npctemplate].mount);
mymount.graphic := Cint(mountparms[1]);
mymount.color := Cint(mountparms[2]);
EquipItem(who, mymount);
endif
endprogram
function Adjustment(who, type)
if(type == "Mage")
SetBaseSkillBaseValue(who, SKILLID_MAGERY, 1000);
SetBaseSkillBaseValue(who, SKILLID_EVALINT, 1000);
SetBaseSkillBaseValue(who, SKILLID_MAGICRESISTANCE, 900);
SetBaseSkillBaseValue(who, SKILLID_TACTICS, 700);
SetBaseSkillBaseValue(who, SKILLID_WRESTLING, 700);
elseif(type == "Thief")
SetBaseSkillBaseValue(who, SKILLID_FENCING, 1000);
SetBaseSkillBaseValue(who, SKILLID_MAGICRESISTANCE, 60);
SetBaseSkillBaseValue(who, SKILLID_TACTICS, 80);
SetBaseSkillBaseValue(who, SKILLID_ANATOMY, 600);
elseif(type == "Paladin")
SetBaseSkillBaseValue(who, SKILLID_MAGICRESISTANCE, 800);
SetBaseSkillBaseValue(who, SKILLID_TACTICS, 1000);
SetBaseSkillBaseValue(who, SKILLID_SWORDSMANSHIP, 1000);
SetBaseSkillBaseValue(who, SKILLID_MACEFIGHTING, 1000);
SetBaseSkillBaseValue(who, SKILLID_FENCING, 1000);
SetBaseSkillBaseValue(who, SKILLID_WRESTLING, 900);
SetBaseSkillBaseValue(who, SKILLID_ANATOMY, 1000);
elseif((type == "Fighter1") || (type == "Fighter2") || (type == "Fighter3") || (type == "Fighter4"))
SetBaseSkillBaseValue(who, SKILLID_MAGICRESISTANCE, 600);
SetBaseSkillBaseValue(who, SKILLID_TACTICS, 900);
SetBaseSkillBaseValue(who, SKILLID_SWORDSMANSHIP, 900);
SetBaseSkillBaseValue(who, SKILLID_MACEFIGHTING, 900);
SetBaseSkillBaseValue(who, SKILLID_FENCING, 900);
SetBaseSkillBaseValue(who, SKILLID_WRESTLING, 900);
SetBaseSkillBaseValue(who, SKILLID_ANATOMY, 900);
endif
endfunction
function pickdestination(me, type)
SetObjProperty(me, "Type", type);
var destination, coords;
if(type == "seeker")
destination := "a dungeon";
SetObjProperty(me, "Coords", "5120 0 6143 2303");
SetObjProperty(me, "Dest", destination);
elseif(type == "Mage")
case(randomint(12) + 1)
1: coords := "470 805 710 1020"; destination := "the city of Yew";
2: coords := "1285 1512 1700 1785"; destination := "the city of Brittain";
3: coords := "2815 605 3050 1005"; destination := "the city of Vesper";
4: coords := "1790 2635 2090 2900"; destination := "the city of Trinsic";
5: coords := "540 2110 685 2290"; destination := "the city of Skara Brae";
6: coords := "2865 3335 3070 3520"; destination := "the city of Serpent's Hold";
7: coords := "3590 2460 3704 2695"; destination := "the city of Ocllo";
8: coords := "4375 1020 4498 1185"; destination := "the city of Moonglow";
9: coords := "2400 370 2545 590"; destination := "the city of Minoc";
10: coords := "3645 2050 3785 2300"; destination := "the city of Magincia";
11: coords := "1300 1665 1515 3925"; destination := "the city of Jhelom";
12: coords := "5120 0 5375 255"; destination := "the city of Wind";
endcase
SetObjProperty(me, "Coords", coords);
SetObjProperty(me, "Dest", destination);
else
case(randomint(14) + 1)
1: coords := "470 805 710 1020"; destination := "the city of Yew";
2: coords := "1285 1512 1700 1785"; destination := "the city of Brittain";
3: coords := "2815 605 3050 1005"; destination := "the city of Vesper";
4: coords := "1790 2635 2090 2900"; destination := "the city of Trinsic";
5: coords := "540 2110 685 2290"; destination := "the city of Skara Brae";
6: coords := "2865 3335 3070 3520"; destination := "the city of Serpent's Hold";
7: coords := "3590 2460 3704 2695"; destination := "the city of Ocllo";
8: coords := "3635 1165 3815 1410"; destination := "the city of Nujel'm";
9: coords := "4375 1020 4498 1185"; destination := "the city of Moonglow";
10: coords := "2400 370 2545 590"; destination := "the city of Minoc";
11: coords := "3645 2050 3785 2300"; destination := "the city of Magincia";
12: coords := "1300 1665 1515 3925"; destination := "the city of Jhelom";
13: coords := "2205 1110 2280 1245"; destination := "the city of Cove";
14: coords := "2650 2070 2765 2265"; destination := "the city of Buccaneer's Den";
endcase
SetObjProperty(me, "Coords", coords);
SetObjProperty(me, "Dest", destination);
endif
endfunction
|
3. Im getting error in login.src because it uses uo.em and your tool didn't included it:
| Code: |
*
* Author: Unreal (MontuZ@Gmail.com) April 28, 2006.
* Version: 1.0
* Core: 096
* Description: Auto Account Creator. Just like many of you know this is a RunUO/SphereServer
* feature and now a POL feature. What it does exactly is when a person trys to login with
* an unknown(non-existant) account. This script creates the account and logs them in.
* Bugs: There shouldn't be any, but you never really know. So if a bug does come up
* please send me an email or post on the forum where you got this(polserver.com)
*
*/
use polsys;
use npc;
use os;
use basicio;
use basic;
include "include/settings";
include "include/accounts";
CONST OFFSET_ACCOUNT_NAME := 0x01;
CONST OFFSET_ACCOUNT_PASS := 0x1F;
CONST INFO_LEN := 30;
enum THEFT_LEVELS
ACCT_NOT_EXIST := 0,
ACCT_LOGIN_OKAY := 1,
ACCT_LOGIN_FAIL := 2,
ACCT_LOGIN_HACK := 3,
endenum
Program Install()
Print( "INSTALLING: Auto Account/Theft Prevention PH..." );
Return 1;
Endprogram
exported function LoginHook(who, byref packet)
who := who; // Avoid compiler warnings.
var username := Packet.GetString(OFFSET_ACCOUNT_NAME, INFO_LEN);
var password := Packet.GetString(OFFSET_ACCOUNT_PASS, INFO_LEN);
if ( !username )
SysLog( "Account/GetString Error: "+username.errortext );
return 0;
elseif ( !password )
SysLog( "Password/GetString Error: "+password.errortext );
return 0;
endif
var theft_level := AcctHackChecks(username, password);
case ( theft_level )
ACCT_NOT_EXIST: // Account doesn't yet exist.
break;
ACCT_LOGIN_OKAY: // Account credentials are valid.
return 0;
break;
ACCT_LOGIN_FAIL: // Account credentials are invalid.
return 0;
break;
ACCT_LOGIN_HACK: // Too many invalid logins. Leave user hanging.
return 1;
break;
endcase
var settings := ACCT_GetSettingsCfgElem("Settings");
if ( !settings.AllowAutoAccounts )
// Automatic account creation is disabled.
return 0;
endif
var account := CreateNewAccount(username, password, 0, settings.DefaultExpansion);
// In theory this should only return an error saying "Invalid parameter type".
// Should never return "Account already exists" because we already looked for the
// account and let pol handle it. And when it does return "Invalid parameter type"
// we don't have to worry, pol will do the right job for us and just say that account
// does not exist.
if ( account.errortext )
SysLog("CreateAccount() Error: "+account.errortext);
return 0;
endif
SysLog( "AutoAccount Created: "+username );
return 0;
endfunction
function AcctHackChecks(username, password)
/*
* This is just a little password protection, so someone doesn't go around
* trying to steal peoples accounts trying 100's of passwords. It doesn't
* really stop someone, but it slows them down a lot and may lead them off
* from trying to steal the account.
* This is currently UNTESTED, in theory it should work. Any problems, again
* please send me an email to MontuZ@Gmail.com or post on the polserver.com's
* forum.
*
*/
/* [Password Protection] */
var account := FindAccount(username);
if ( !account )
// Account doesn't even exist.
return ACCT_NOT_EXIST;
elseif ( !account.CheckPassword(password) )
var failed_login := account.GetProp("#FailedLogin");
// First attempt at failing the password check.
if ( !failed_login )
account.SetProp( "#FailedLogin", {1, POLCore().systime});
return ACCT_LOGIN_FAIL; // Let pol tell the user it's an incorrect password.
else
if ( failed_login[1] >= 5 && ( failed_login[2] >> POLCore().systime ) )
// Incorrect password for the 5th time.
// Leave the user hanging at login for the next 10 minutes.
account.SetProp("#FailedLogin", {failed_login[1]+1, POLCore().systime+600});
return ACCT_LOGIN_HACK; // Leave user hanging.
elseif ( failed_login[1] >= 5 && ( failed_login[2] << POLCore().systime ) )
// User attempted to login with the wrong password after 10 minutes.
// Reset user's wait time.
account.EraseProp("#FailedLogin");
return ACCT_LOGIN_FAIL; // Let pol tell the user it's an incorrect password.
elseif ( failed_login[1] << 5 )
// Let pol tell user it's an incorrect password.
account.SetProp("#FailedLogin", {failed_login[1]+1, POLCore().systime+10});
return ACCT_LOGIN_FAIL;
endif
endif
else
// Passed password check, let user login.
return ACCT_LOGIN_OKAY;
endif
endfunction
|
| Quote: | It's possible it picked up on the word "move" which is an npc.em function. It shouldn't do that though. Additionally, there are no uo.em functions in that script, so why do you think it should be in there?
|
It should be here because constant "INSERT_ADD_ITEM" it's in uo.em
|
|
 |
|
|
 |
 |
|