This place is for Closed bug reports only. NOT for asking help!
Moderators: Moderators , Developers
kitoy
Noob
Posts: 4 Joined: 17 Jun 2010, 04:46
Noob?: Yes
#1
Post
by kitoy » 17 Jun 2010, 05:08
Hi All,
I've been trying ways to use a bot and mercenary scroll and autostorage but I'm out of ideas. Every time my bot autostore items due to arrows lower than 100, the merce scroll creates problems. I tried using the items_control.txt with the code:
But I think this will not work as openkore interprets the "4" as the minimum and not the 5. I checked the items.txt and the scroll is already there as:
Is there any way to use the ItemID instead of the ItemName on items_control.txt? I've been looking for examples but found none so far.
h4rry84
Moderators
Posts: 234 Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House
#2
Post
by h4rry84 » 17 Jun 2010, 12:41
you could have simply edit the items.txt to the other name example 12156#BowScroll4#
kitoy
Noob
Posts: 4 Joined: 17 Jun 2010, 04:46
Noob?: Yes
#3
Post
by kitoy » 18 Jun 2010, 03:18
Yes its now working. Thanks
Technology
Super Moderators
Posts: 801 Joined: 06 May 2008, 12:47
Noob?: No
#4
Post
by Technology » 18 Jun 2010, 09:28
Maybe kore should also accept the name_with_underscores notation?
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...
Mount Doom awaits us, fellowship of OpenKore!
kLabMouse
Administrator
Posts: 1301 Joined: 24 Apr 2008, 12:02
#5
Post
by kLabMouse » 18 Jun 2010, 09:34
Technology wrote: Maybe kore should also accept the name_with_underscores notation?
Or may-be name in "..." or '...' like: "Bowman Scroll 4"
kitoy
Noob
Posts: 4 Joined: 17 Jun 2010, 04:46
Noob?: Yes
#6
Post
by kitoy » 18 Jun 2010, 09:40
or itemID?
EternalHarvest
Developers
Posts: 1798 Joined: 05 Dec 2008, 05:42
Noob?: Yes
#7
Post
by EternalHarvest » 27 Jul 2010, 17:57
It doesn't accept item IDs?
obietobi
Noob
Posts: 13 Joined: 16 Mar 2010, 11:48
Noob?: Yes
#8
Post
by obietobi » 08 Aug 2010, 00:43
right this..
Bowman Scroll4 0 0 0
Scroll and 4 without space
sampah001
Noob
Posts: 3 Joined: 29 Jun 2009, 10:27
Noob?: Yes
#9
Post
by sampah001 » 09 Aug 2010, 17:21
kLabMouse wrote: Technology wrote: Maybe kore should also accept the name_with_underscores notation?
Or may-be name in "..." or '...' like: "Bowman Scroll 4"
how about using "itemname"
like this
change on script src/FileParsers.pm
Code: Select all
($key, $args) = lc($line) =~ /([\s\S]+?)[\s]+(\d+[\s\S]*)/;
change to
Code: Select all
if ($line =~ /"/) {
($key, $args_text) = $line =~ /^"([\s\S]+?)" (\d+[\s\S]*)/i;
}
else {
($key, $args_text) = $line =~ /^([\s\S]+?) (\d+[\s\S]*)/i;
}
FileParsers.pm
Code: Select all
sub parseItemsControl {
my $file = shift;
my $r_hash = shift;
undef %{$r_hash};
my ($key, $args_text, %cache);
my $reader = new Utils::TextReader($file);
while (!$reader->eof()) {
my $line = $reader->readLine();
$line =~ s/\x{FEFF}//g;
next if ($line =~ /^#/);
$line =~ s/[\r\n]//g;
$line =~ s/\s+$//g;
if ($line =~ /"/) {
($key, $args_text) = $line =~ /^"([\s\S]+?)" (\d+[\s\S]*)/i;
}
else {
($key, $args_text) = $line =~ /^([\s\S]+?) (\d+[\s\S]*)/i;
}
next if ($key eq "");
if ($cache{$args_text}) {
$r_hash->{$key} = $cache{$args_text};
} else {
my @args = split / /, $args_text;
my %item = (
keep => $args[0],
storage => $args[1],
sell => $args[2],
cart_add => $args[3],
cart_get => $args[4]
);
# Cache similar entries to save memory.
$r_hash->{$key} = $cache{$args_text} = \%item;
}
}
return 1;
}
kLabMouse
Administrator
Posts: 1301 Joined: 24 Apr 2008, 12:02
#10
Post
by kLabMouse » 09 Aug 2010, 17:40
Nice!. But this also need Input filter at first place, so any \" in item names are replaced with \'
that will guarantee that \" will indicate sentence start and end.