-
depp69
- Posts: 30
- Joined: Mon Aug 17, 2009 12:46 pm
#1
Post
by depp69 » Tue Feb 09, 2010 5:44 pm
hello there,
im trying to load some paths at onload-profile-section:
thats what i tried so far:
Code: Select all
<onLoad>
if(player.level == 2) then
loadPaths("my110/l2-3_wolf");
end;
if(player.level == 3) then
loadPaths("my110/l3-4_bear");
end;
if(player.level == 4) then
loadPaths("my110/l3-4_bear");
end;
</onLoad>
but it still loads the default path
is there any way to get this working?
greetings depp
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#2
Post
by Administrator » Tue Feb 09, 2010 8:01 pm
That's because the path set in your profile will be loaded after the profile is loaded, as per the documentation. It makes no sense to load the path in your profile before even loading the profile. You are abusing the onLoad event.
-
depp69
- Posts: 30
- Joined: Mon Aug 17, 2009 12:46 pm
#3
Post
by depp69 » Mon Feb 22, 2010 5:41 am
so is this an error @ wiki:
http://www.solarstrike.net/wiki/index.p ... e_-_Events
theres also a path loaded in onload section -.-
also i read somewhere, onload can be used to overwrite profile options,
but you are saying its loaded before the profile so you cant overwrite anything ...
so what is this onload section for?
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#4
Post
by Administrator » Mon Feb 22, 2010 7:31 am
You're right that the wiki is wrong. You could try something, though. Open rom/bot.lua, and go to (CTRL+G) line 311. You'll see this:
Code: Select all
if( settings.profile.options.WAYPOINTS ) then
Change to:
Code: Select all
if( settings.profile.options.WAYPOINTS and __WPL == nil ) then
Save. It might now let you load waypoints from within the onLoad event without it being overwritten.
but you are saying its loaded before the profile so you cant overwrite anything ...
That's not quite what I said. The onLoad event is part of the profile, so it must be loaded first. Afterwards, the waypoint list from your profile is loaded (which would overwrite the current waypoint list loaded using the loadPaths() function).
-
depp69
- Posts: 30
- Joined: Mon Aug 17, 2009 12:46 pm
#5
Post
by depp69 » Mon Feb 22, 2010 12:24 pm
alright, i guess this will do it, thx
-
d003232
- Posts: 1252
- Joined: Wed Jun 03, 2009 4:27 pm
#6
Post
by d003232 » Tue Feb 23, 2010 12:21 pm
Administrator wrote:You're right that the wiki is wrong.
In my opition it's not wrong. I can't remeber it 100% but I thought I did sometime a change in the coding so that it is possible to load paths within the <onLoad> event. So one can overwrite the path from the profile by using the <onLoad> event.
I suppose the error is becaus you have a typo in your coding. It should be
and not
Best way to check everything if to printout the used variables in the <onLoad> event to check the content.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest