Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Lua
➜ String Manipulation
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
4
Posted by
| Kevnuke
USA (145 posts) Bio
|
Date
| Reply #45 on Mon 16 Apr 2012 12:31 AM (UTC) |
Message
| Yea it didn't work..the aliases i'm making aren't provoking a response from the server. What's wrong with them? | Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #46 on Mon 16 Apr 2012 07:26 AM (UTC) |
Message
|
function ProvokeInventory()
SendPkt("\255\250\201Char.Items.Inv\255\240")
end
That just defines a function. It doesn't execute it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Kevnuke
USA (145 posts) Bio
|
Date
| Reply #47 on Mon 16 Apr 2012 11:54 PM (UTC) |
Message
| Wow I can't believe I didn't catch that. Rookie mistake. Thanks Nick | Top |
|
Posted by
| Kevnuke
USA (145 posts) Bio
|
Date
| Reply #48 on Tue 17 Apr 2012 01:12 AM (UTC) |
Message
| Sooo I have a brand new problem. I'm trying to integrate the new curing items from achaea into my curing system without completely rewriting it. First, here's the code:
herbaff = {
"addiction",
"agoraphobia",
"asthma",
"blind",
"claustrophobia"
}
herbcure = {
addiction = GinsengFerrumChoice() or "ginseng",
agoraphobia = LobeliaArgentumChoice() or "lobelia",
asthma = KelpAurumChoice() or "kelp",
blind = BayberryArsenicChoice() or "bayberry",
claustrophobia = LobeliaArgentumChoice() or "lobelia",
}
function GinsengFerrumChoice ()
if outr.ginseng > 0 then
return "ginseng"
end
if outr.ferrum > 0 then
return "ferrum"
end
if inr.ginseng > 0 then
return "ginseng"
end
if inr.ferrum > 0 then
return "ferrum"
end
end
function CureHerb ()
for k, v in ipairs (herbaff) do
if aff[v] then
_G["herb"] = herbcure[v]
if not (herb == "hawthorn") then
if (tonumber(outr[herb]) > 0) then
if EatGo() then
HerbEat()
Send ("eat " .. herbcure[v])
return
end
elseif (tonumber(inr[herb]) > 0) then
if OutrGo() then
HerbOutr()
Send ("outr " .. herbcure[v])
return
end
end
elseif balance.hawthorn then
if (outr.hawthorn > 0) then
if EatGo() then
HerbEat()
Send ("eat hawthorn")
return
end
elseif (inr.hawthorn > 0) then
if OutrGo() then
HerbOutr()
Send ("outr hawthorn")
return
end
end
return
end
end
end
end
They pretty much made it so each affliction has two items that can cure it. My systems fine if I want to ONLY use the existing curing items, but i wanted to make it so that my curing system automatically uses the secondary item for each cure if I run out of the primary curing item. outr.<cure> refers to items that are in my inventory (and thus ready to be eaten) inr.<cure> refers to a cure that I have more of but are still in my rift.
In the case of the example function I showed, it would first check to see if I have ginseng in my inventory, then ferrum. If neither is in my inventory, it checks to see if either one is in my rift, checking ginseng first, then ferrum. | Top |
|
Posted by
| Kevnuke
USA (145 posts) Bio
|
Date
| Reply #49 on Wed 18 Apr 2012 12:44 AM (UTC) |
Message
| Actually, I had an epiphany. I think I'm just going to scrap that idea and recode it to work around the two choices each being an index in the table for each affliction. Like so:
herbcure = {
addiction = {"ginseng", "ferrum"},
agoraphobia = {"lobelia", "argentum"},
asthma = {"kelp", "aurum"},
blind = {"bayberry", "arsenic"},
claustrophobia = {"lobelia", "argentum"},
}
And then I'll modify the CureHerb function to make it work. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
107,684 views.
This is page 4, subject is 4 pages long:
1
2
3
4
It is now over 60 days since the last post. This thread is closed.
Refresh page
top