Changes in lua language cause error in ai script - automation

When I run script in game, I got an error message like this:
.\AI\haick.lua:104: bad argument #1 to 'find' (string expected, got nill)
local haick = {}
haick.type = type
haick.tostring = tostring
haick.require = require
haick.error = error
haick.getmetatable = getmetatable
haick.setmetatable = setmetatable
haick.ipairs = ipairs
haick.rawset = rawset
haick.pcall = pcall
haick.len = string.len
haick.sub = string.sub
haick.find = string.find
haick.seed = math.randomseed
haick.max = math.max
haick.abs = math.abs
haick.open = io.open
haick.rename = os.rename
haick.remove = os.remove
haick.date = os.date
haick.exit = os.exit
haick.time = GetTick
haick.actors = GetActors
haick.var = GetV
--> General > Seeding Random:
haick.seed(haick.time())
--> General > Finding Script Location:
local scriptLocation = haick.sub(_REQUIREDNAME, 1, haick.find(_REQUIREDNAME,'/[^\/:*?"<>|]+$'))
Last line (104 in file) causes error and I don`t know how to fix it.
There are links to .lua files below:
https://drive.google.com/file/d/1F90v-h4VjDb0rZUCUETY9684PPGw7IVG/view?usp=sharing
https://drive.google.com/file/d/1fi_wmM3rg7Ov33yM1uo7F_7b-bMPI-Ye/view?usp=sharing
Help, pls!

When you use a function in Lua, you are expected to pass valid arguments for the function.
To use a variable, you must first define it, _REQUIREDNAME in this case is not available, haick.lua file is incomplete. The fault is of the author of the file.
Lua has a very useful reference you can use if you need help, see here

Related

Requested module experienced an error while loading - Server - Data:11

Yeah So, I'm coding a Roblox game and this script gets an error every time, I even restarted roblox studio to try fixing it but it didn't work and I tried messing around with the code but I couldn't figure it out, can someone please help?
Script:
local PetModule = require(ServerModules.PetModule)
Module Code:
local module = {}
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Pet = ReplicatedStorage.Pet
function module.EquipPet(Player, PetName)
local PetModel = Pet:FindFirstChild(PetName)
if PetModel then
PetModel = PetModel:Clone()
PetModel.Parent = workspace.Pet:FindFirstChild((Player.Name))
if Player then
local Character = Player.Character
if Character then
if not Character.HumanoidRootPart:FindFirstChild("PetAttachments") then
local PetAttachments = Instance.new("Folder")
PetAttachments.Name = "PetAttachments"
PetAttachments.Parent = Character.HumanoidRootPart
local PetAttachments = Character.HumanoidRootPart:FindFirstChild("PetAttachments")
if PetAttachments then
local att0 = Instance.new("Attachment")
att0.Name = "Attachment1"
att0.Position = PetModel:FindFirstChild("AttachmentPosition").Value
att0.Parent =Character.HumanoidRootPart
local att1 = Instance.New("Attachment")
att1.Name = "Attachment2"
att1.Parent = PetModel.PrimaryPart
local AlignPosition = Instance.new("AlignPosition")
AlignPosition.Attachment0 = att0
AlignPosition.Attachment1 = att1
AlignPosition.RigidityEnabled = false
AlignPosition.MaxForce = PetModel.MaxForce.Value
AlignPosition.Responsiveness = PetModel.Responsiveness.Value
AlignPosition.Parent = PetModel.PrimaryPart
local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.Attachment0 = att0
AlignOrientation.Attachment1 = att1
AlignOrientation.RigidityEnabled = false
AlignOrientation.MaxTorque = PetModel.MaxForce.Value
AlignOrientation.Responsiveness = PetModel.Responsiveness.Value
AlignOrientation.Parent = PetModel.PrimaryPart
game:GetService("RunService").Heartbeat:Connect(function()
att0.Position = PetModel.AttachmentPosition.Value
AlignPosition.MaxForce = PetModel.MaxForce.Value
AlignOrientation.MaxTorque = PetModel.MaxForce.Value
AlignPosition.Responsiveness = PetModel.Responsiveness
end)
end
end
end
end
end
function module.UnequipPet(Player)
end
function module.UnequipAllPet(Player)
end
return module
end
If anyone could help me fix this it would be great.
make sure to put "return module" at the end!
return module
is within the function. Try to put it free at the end of the code and...
I'm not sure, but I think it's because you're creating an event connection within module, I had this problem right now. I just stopped creating events within the Module and the problem stopped.
Try removing this from de Code.
game:GetService("RunService").Heartbeat:Connect(function()
att0.Position = PetModel.AttachmentPosition.Value
AlignPosition.MaxForce = PetModel.MaxForce.Value
AlignOrientation.MaxTorque = PetModel.MaxForce.Value
AlignPosition.Responsiveness = PetModel.Responsiveness
end)

Still not understanding settingwithcopy warning

I want to isolate a string but I keep getting a setting with copy error. I read the other threads on settingwithcopy warnings but I don't understand why those solutions don't work here.
I've tried using:
df['Title'][i] = delBy[i]
df.Title[i] = delBy[i]
df[df.Title][i] = delBy[i]
df.loc[df.Title][i] = delBy[i]
df.loc[i]['Title'] = delBy[i]
Actual code:
delBy = df['Title'].str.extract(r'(.+?)(?= [bB]y)', expand = False)
for i in df.index:
if pd.notna(delBy[i]) == True:
df['Title'][i] = delBy[i]
else:
continue
If title has keywords by or By (ex: Animal by John) keep only title (Animal). Leave other titles alone (ex: Meditations)
It looks that you want to delete "by ..." part, where it can be done.
Then start from:
delBy = df.Title.str.extract(r'(.+?)(?= [bB]y)', expand = False).dropna()
(note that I added .dropna()).
Then, instead of your loop, just update this column (in place):
df.Title.update(delBy)
A shorter solution, isn't it?

parse_failed error occured in augeas,why this error occur and how to fix this issue?

I want to edit file "myfileDB.properties" using augeas. so used Properties.lns.
but it made error "parse_failed"and some time "parse_skel_failed". explain the root cause of this error and solve this issue.
augtool> print /augeas/files/root/yog/myfileDB.properties/error/
/augeas/files/root/yog/myfileDB.properties/error = "parse_failed"
/augeas/files/root/yog/myfileDB.properties/error/pos = "17835"
/augeas/files/root/yog/myfileDB.properties/error/line = "318"
/augeas/files/root/yog/myfileDB.properties/error/char = "0"
/augeas/files/root/yog/myfileDB.properties/error/lens = "/usr/share /augeas/lenses/dist/properties.aug:50.25-.100:"
/augeas/files/root/yog/myfileDB.properties/error/message = "Iterated lens matched less than it should"
/augeas/files/root/yog/myfileDB.properties/error = "parse_skel_failed"
/augeas/files/root/yog/myfileDB.properties/error/pos = "4844943"
/augeas/files/root/yog/myfileDB.properties/error/line = "53707"
/augeas/files/root/yog/myfileDB.properties/error/char = "0"
/augeas/files/root/yog/myfileDB.properties/error/lens = "/usr/share/augeas/lenses/dist/simplevars.aug:34.10-.46:"
/augeas/files/root/yog/myfileDB.properties/error/message = "Iterated lens matched less than it should"

Zend Framework: Multidb fails to initialize

This used to work but after some modifications by the other programmers it just fails to work. I have this code on my Bootstrap:
protected function _initDatabase ()
{
$resource = $this->getPluginResource('multidb');
$resource->init();
Zend_Registry::set('gtap', $resource->getDb('gtap'));
Zend_Registry::set('phpbb', $resource->getDb('phpbb'));
}
Upon loading, this error shows up:
Fatal error: Call to a member function init() on a non-object in
/var/www/gamebowl3/application/Bootstrap.php on line 105
My php.ini has this entry on tis include_path:
.:/usr/share/php:/etc/apache2/libraries
and the i can see that multidb.php is located in:
/etc/apache2/librarties/Zend/Application/Resource
Can somebody tell me what causes the error? Thanks!
I just found out that the problem is in application.ini. Added a newly-introduced setting to the usual set of configs. Here it is:
;Gtap Database
resources.multidb.gtap.adapter = "PDO_MYSQL"
resources.multidb.gtap.host = "localhost"
resources.multidb.gtap.username = "root"
resources.multidb.gtap.password = "letmein1"
resources.multidb.gtap.dbname = "gtap"
resources.multidb.gtap.isDefaultTableAdapter = true
resources.multidb.gtap.default = true
;Forum Database
resources.multidb.phpbb.adapter = "PDO_MYSQL"
resources.multidb.phpbb.host = "localhost"
resources.multidb.phpbb.username = "root"
resources.multidb.phpbb.password = "letmein1"
resources.multidb.phpbb.dbname = "phpbb"
resources.multidb.phpbb.isDefaultTableAdapter = false
Also, make sure you have the latest Zend Framework Library and add it to PHP's include path. That should fix everything up.

Hard time debugging Local Variable in XCode

I'm having a hard-time debugging a local variable. I'm running gcc 4.2, XCode 3.2.4, base SDK Mac OS 10.5, and Objective-C++ in Debug-Mode.
Here's the issue. I'm working on trying to understand some code and it goes like this:
#define MAX4D 500
...
NSMutableArray *viewerPix[ MAX4D ];
When I hover over it during debug (pause on the line before and after) I get this
Unable to access variable "viewerPix"
Unable to access variable "viewerPix"
Unable to access variable "viewerPix"
...
repeated until I kill the application. What would cause this? I've tried setting it to a lower number... but to no avail. Even after I actually set the C-Array:
viewerPix[0] = [[NSMutableArray alloc] initWithCapacity:0];
I still get the same repeated error message.
However, if I don't mouse-over the value (or debug) it "appears" to run fine, even doing stuff like:
[viewerPix[0] addObject: dcmPix];
if( [viewerPix[0] count] != [loadList count])...
but if I debug after those steps, it crashes just like before. Here are my build settings:
STRIPFLAGS =
ALTERNATE_GROUP = $(INSTALL_GROUP)
ALTERNATE_OWNER = $(INSTALL_OWNER)
ALTERNATE_MODE = $(INSTALL_MODE_FLAG)
ALTERNATE_PERMISSIONS_FILES =
DEPLOYMENT_LOCATION = NO
DEPLOYMENT_POSTPROCESSING = NO
INSTALL_GROUP = $(GROUP)
INSTALL_OWNER = $(USER)
INSTALL_MODE_FLAG = u+w,go-w,a+rX
DSTROOT = /tmp/$(PROJECT_NAME).dst
INSTALL_PATH = $(HOME)/Applications
SKIP_INSTALL = NO
COPY_PHASE_STRIP = NO
STRIP_INSTALLED_PRODUCT =
STRIP_STYLE = debugging
SEPARATE_STRIP = NO
GCC_FAST_OBJC_DISPATCH = YES
GCC_AUTO_VECTORIZATION = NO
GCC_OBJC_CALL_CXX_CDTORS = YES
GCC_ENABLE_SSE3_EXTENSIONS = NO
GCC_ENABLE_SSE41_EXTENSIONS = NO
GCC_ENABLE_SSE42_EXTENSIONS = NO
GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = NO
GCC_STRICT_ALIASING = NO
GCC_FEEDBACK_DIRECTED_OPTIMIZATION = Off
GCC_ENABLE_FIX_AND_CONTINUE = NO
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
GCC_DYNAMIC_NO_PIC = NO
GCC_GENERATE_TEST_COVERAGE_FILES = NO
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
GCC_MODEL_TUNING = G5
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
GCC_ENABLE_KERNEL_DEVELOPMENT = NO
GCC_DEBUGGING_SYMBOLS = default
GCC_REUSE_STRINGS = YES
GCC_NO_COMMON_BLOCKS = NO
GCC_ENABLE_OBJC_GC = unsupported
GCC_OPTIMIZATION_LEVEL = 0
GCC_FAST_MATH = NO
GCC_ENABLE_SYMBOL_SEPARATION = YES
GCC_THREADSAFE_STATICS = YES
GCC_SYMBOLS_PRIVATE_EXTERN = NO
GCC_UNROLL_LOOPS = NO
GCC_MODEL_PPC64 = NO
I don't know what else to say. Let me know what more information is needed, because I'm at a loss. There's also no 'build' tab when I get-info on the .mm file. Just General, Target, Comments (some helps I checked said to remove file-specific tags).
Should I initialize that c-array to nil? I can't just do.. array[500] = {nil}; right? that's C#?
I was using LLVM and Clang 1.5, but I switched to GCC 4.2 since I wasn't getting any local symbols. Am I missing something??
If the optimizer is on, that can effectively eliminate local variables.
However, why a C array of mutable ObjC arrays? That seems odd.
check Product->Scheme->Edit Scheme->Run xxx, Build Configuration is Debug, if that is Release happened you see.