Posts: 1
Threads: 1
Joined: Sep 2015
I want to make a game in Internet.I have already done it by win32API. Now I think whether I use the cmd of "require" to import Ruby's lib??
tip: I'm a Chinese and weak in English.......
Posts: 11,228
Threads: 648
Joined: May 2009
我從來沒有嘗試過使用它,直到如今。我不認為它喜歡我。甚至當我用的是整個文件路徑,我收到一個錯誤。它說,該文件不存在,甚至與整個路徑。
我只是複製使用它的腳本到腳本庫,而不是。一個.RB文件只是Ruby代碼的文本文件反正。至少,這就是每次我反正看到。
這與谷歌翻譯。我的中國是很好的餐廳,沒有別的訂購。
I never tried to use it until now. I do not think it likes me. Even when I use the entire file path, I receive an error. It says the file does not exist, even with the whole path.
I would just copy the script into the script library instead of using it. A .rb file is just a text file of ruby code anyway. At least, that's what every I've seen anyway.
------------ Anyone else??? ---------------
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 4,606
Threads: 543
Joined: Dec 2009
You could try using load instead of require. Here is a small script to test it.
File contents
Code:
class NewsUpdate
attr_reader :recent_events
def initialize
@recent_events = ['Eh...']
print 'These are the news!'
end
def print_news
print @recent_events.join("\n")
end
end
Script call to load the file
load Dir.pwd + '/print text.rbw'
Simple example of how to create a new copy of the class included in the file only
$news = NewsUpdate.new
Simple example of how to call one of its methods by meas of a script call
$news.print_news
The downside of load methods is that it will actually load the file contents every time they are called. At least that's what happens on normal situations.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest &
Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE,
RandomEnkounters XP,
KSkillShop XP,
Kolloseum States XP,
KEvents XP,
KScenario XP & Gosu,
KyoPrizeShop XP Mangostan,
Kuests XP,
KyoDiscounts XP VX, ACE & MV,
KChest XP VX & ACE 2016,
KTelePort XP,
KSkillMax XP & VX & ACE,
Gem Roulette XP VX & VX Ace,
KRespawnPoint XP, VX & VX Ace,
GiveAway XP VX & ACE,
Klearance XP VX & ACE,
KUnits XP VX, ACE & Gosu 2017,
KLevel XP,
KRumors XP & ACE,
KMonsterPals XP VX & ACE,
KStatsRefill XP VX & ACE,
KLotto XP VX & ACE,
KItemDesc XP & VX,
KPocket XP & VX,
OpenChest XP VX & ACE