PORT OPEN 9600
Total : 549941 bytes
Used : 0 bytes
Remain: 549941 bytes
> file.remove("1.lua");
file.open("1.lua","w+");
w>> = file.writeline
w([==[wifi.setmode(wifi.STATION)]==]);
w([==[wifi.sta.config("Vascon_WiFi_24","13551369")]==]);
w([==[print(wifi.sta.getip())]==]);
w([==[led1 = 3]==]);
w([==[led2 = 4]==]);
w([==[gpio.mode(led1, gpio.OUTPUT)]==]);
w([==[gpio.mode(led2, gpio.OUTPUT)]==]);
w([==[srv=net.createServer(net.TCP)]==]);
w([==[srv:listen(80,function(conn)]==]);
w([==[ conn:on("receive", function(client,request)]==]);
w([==[ local buf = "";]==]);
w([==[ local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");]==]);
w([==[ if(method == nil)then]==]);
w([==[ _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");]==]);
w([==[ end]==]);
w([==[ local _GET = {}]==]);
w([==[ if (vars ~= nil)then]==]);
w([==[ for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do]==]);
w([==[ _GET[k] = v]==]);
w([==[ end]==]);
w([==[ end]==]);
w([==[ buf = buf.."<h1> ESP8266 Web Server</h1>";]==]);
w([==[ buf = buf.."<p>GPIO0 <a href="?pin=ON1"><button>ON</button></a> <a href="?pin=OFF1"><button>OFF</button></a></p>";]==]);
w([==[ buf = buf.."<p>GPIO2 <a href="?pin=ON2"><button>ON</button></a> <a href="?pin=OFF2"><button>OFF</button></a></p>";]==]);
w([==[ local _on,_off = "",""]==]);
w([==[ if(_GET.pin == "ON1")then]==]);
w([==[ gpio.write(led1, gpio.HIGH);]==]);
w([==[ elseif(_GET.pin == "OFF1")then]==]);
w([==[ gpio.write(led1, gpio.LOW);]==]);
w([==[ elseif(_GET.pin == "ON2")then]==]);
w([==[ gpio.write(led2, gpio.HIGH);]==]);
w([==[ elseif(_GET.pin == "OFF2")then]==]);
w([==[ gpio.write(led2, gpio.LOW);]==]);
w([==Є[Кэ@4z
hя)Ующзш
NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4
lua: cannot open init.lua
> file.remove("1.lua");
file.open("1.lua","w+");
w = file.writelin> 551369")]==]);
w([==[print(wifi.sta.getip())]==]);
w([==[led1 = 3]==]);
w([==[led2 = 4]==]);
w([==[gpio.mode(led1, gpio.OUTPUT)]==]);
w([==[gpio.mode(led2, gpio.OUTPUT)]==]);
w([==[srv=net.createServer(net.TCP)]==]);
w([==[srv:listen(80,function(conn)]==]);
w([==[ conn:on("receive", function(client,request)]==]);
w([==[ local buf = "";]==]);
w([==[ local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");]==]);
w([==[ if(method == nil)then]==]);
w([==[ _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");]==]);
w([==[ end]==]);
w([==[ local _GET = {}]==]);
w([==[ if (vars ~= nil)then]==]);
w([==[ for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do]==]);
w([==[ _GET[k] = v]==]);
w([==[ end]==]);
w([==[ end]==]);
w([==[ buf = buf.."<h1> ESP8266 Web Server</h1>";]==]);
w([==[ buf = buf.."<p>GPIO0 <a href="?pin=ON1"><button>ON</button></a> <a href="?pin=OFF1"><button>OFF</button></a></p>";]==]);
w([==[ buf = buf.."<p>GPIO2 <a href="?pin=ON2"><button>ON</button></a> <a href="?pin=OFF2"><button>OFF</button></a></p>";]==]);
w([==[ local _on,_off = "",""]==]);
w([==[ if(_GET.pin == "ON1")then]==]);
w([==[ gpio.write(led1, gpio.HIGH);]==]);
w([==[ elseif(_GET.pin == "OFF1")then]==]);
w([==[ gpio.write(led1, gpio.LOW);]==]);
w([==[ elseif(_GET.pin == "ON2")then]==]);
w([==[ gpio.write(led2, gpio.HIGH);]==]);
w([==[ elseif(_GET.pin == "OFF2")then]==]);
w([==[ gpio.write(led2, gpio.LOW);]==]);
w([==[ end]==]);
w([==[ client:send(buf);]==]);
w([==[ client:close();]==]);
w([==[ collectgarbage();]==]);
w([==[ end)]==]);
w([==[end)]==]);
file.close();
dofile("1.lua");
stdin:1: unexpected symbol near ';'
>
Страница 1 из 3
-
Привет всем. Пытаюсь сделать передачу температуры с поста глядите что я сделал. Передача от батареек в нородман. Делаю все по инструкции. Загружаю код от ds18b20, и код ниже для проверки:
ap = «1111»
appass = «1111»
pin = 4 — сюда вешаем датчики
sleepdelay = 600 — десять минут между проверками = 600 секунд.
killdelay = 35 — через 35 секунд после пробуждения — спать принудительно.
— killdelay зависит от скорости вашего соединения. Отрегулируйте! Чем меньше — тем лучше,
— но если слишком мало — модуль не успеет передать данные и принудительно уйдет в сон.
countsleep = 12 — двенадцать циклов проверки до принудительной передачи = 2 часа
— устанавливайте сами сколько считаете правильным. Чем меньше — тем больше расход батареи.function sendNarod(temperature)
wifi.setmode(wifi.STATION)
wifi.sta.config(ap , appass)
wifi.sta.autoconnect(0)tmr.alarm(0, 1000, 1, function()
if wifi.sta.status() == 5 and wifi.sta.getip() ~= nil then
print(«Got wi-fi!»)
tmr.stop(0)
local dataN = «#8E-CE-4E-E2-49-56n» — ваш ключ!!!
print(«T = «..temperature)
dataN =dataN..»#T01#»..temperature..»n»
dataN = dataN..»##n»
print(dataN)
conn=net.createConnection(net.TCP, 0)
conn:on(«connection»,function(conn, payload)
conn:send(dataN)
end)
conn:on(«receive», function(conn, payload)
print(‘nRetrieved in ‘..((tmr.now()-t)/1000)..’ milliseconds.’)
print(‘Narodmon says ‘..payload)
conn:close()
disconnect()
end)
t = tmr.now()
conn:connect(8283,’narodmon.ru’)
end
end)
endfunction publish_data()
print(«work now!»)
local t = 85
t = getTemp()
print(«Got «..t)
if t ~= 85 then
local oldt = rtcmem.read32(0)
local count = rtcmem.read32(1)
if (count + 1) < 1 then
rtcmem.write32(1, 0)
else
rtcmem.write32(1, (count+1))
end
rtcmem.write32(1, (count+1))
print(«oldt «..oldt)
local delta = t — oldt
if delta < 0 then
delta = delta * -1
end
print(«Delta «..delta)
print(«count = «..count)
if (delta >or (count > countsleep) then
rtcmem.write32(0, t)
print(«countsleep = «..count)
rtcmem.write32(1, 0)
if bit.isset(t, 15) then t = 1 — bit.bxor(t, 0xffff) end
t = t * 625 / 10000
print(«t = «..t)
print(«Pubish Data!»)
sendNarod(t)
else
print(«Not changes. Go…»)
disconnect()
end
end
endfunction getTemp()
print(«get t»)
local t = 85
local ds18b20 = require(‘ds18b20’)
ds18b20.setup(pin)
local addres={}
addres=ds18b20.addrs()
if addres[1] ~= nil then
t = ds18b20.read(addres[1])
end
print(«Got «..t)
return t
endfunction disconnect()
tmr.alarm(3, 500, 0, function()
print(«Sleep Now!»)
node.dsleep(1000000*sleepdelay, 4)
end)
end
tmr.alarm(5, 1000*killdelay, 0, function()
print(«Get Sleep By Timer»)
disconnect()
end)publish_data()
Последнее редактирование: 12 ноя 2022
-
Выводит такую ошибку которая ниже, файл script.lua чуть выше. Где моя ошибка?
> dofile(«script.lua»)
script.lua:1: unexpected symbol near ‘п’
stack traceback:
[C]: in function ‘dofile’
stdin:1: in main chunk
> -
Покажите ваш Nodemcu Startup Banner. То, что выводится при рестарте ESP.
-
Тут, полагаю, две проблемы.
Система говорит о неожиданном символе где-то. Значит проблема в копипасте — захвачен нечитаемый символ и иногда эту никчемную ошибку очень сложно найти.Вторая проблема будет с таймером «ноль» — видно что проект очень старый или скопипащен из старых файлов.
Обычно дают ссылку на первоисточник, тов. @Airat777
-
Я поэтому startup banner и попросил. Без этого дальше двигаться нет смысла.
-
Да это я ваш проект хотел повторить ИгорьК.
Щас до дома доберусь, скину Nodemcu StartupBanner .
https://forum.amperka.ru/threads/es…ринг-Бюджетный-вариант.4568/page-8#post-76010 -
Там простая версия работает, а именно от двух батареек нет. Да, таймер ноль тоже какую то ошибку писало, а щас вот эта буква «п». Давно пытаюсь от двух батареек сделать, не получается…
-
Вот:
node.restart()
>
ets Jan 8 2013,rst cause:1, boot mode:(3,7)load 0x40100000, len 26940, room 16
tail 12
chksum 0xf3
ho 0 tail 12 room 4
load 0x3ffe8000, len 2264, room 12
tail 12
chksum 0xe5
ho 0 tail 12 room 4
load 0x3ffe88d8, len 136, room 12
tail 12
chksum 0x91
csum 0x91
„вдѓnмЫ{‚тo|мlll$ ЊвrЫlЊ¬эNodeMCU custom build by frightanic.com
branch: master
commit: b96e31477ca1e207aa1c0cdc334539b1f7d3a7f0
SSL: false
modules: adc,bit,cjson,cron,file,gpio,http,mqtt,net,node,ow,rtctime,sntp,tmr,uart,wifi
build built on: 2017-02-06 12:36
powered by Lua 5.1.4 on SDK 2.0.0(656edbf)
lua: cannot open init.lua
> print(uart.setup(0, 115200, 8, 0, 1, 1 ))
115200
>
—————————-
ds18b20.lua : 1796 bytes
script.lua : 3594 bytes
—————————-
Total file(s) : 2
Total size : 5390 bytes -
Но щас скопировал по другому, и буква «п» пропала. Но щас пишет вот так и температуру на народман не отправляет. Тоже какая то ошибка походу:
NodeMCU custom build by frightanic.com
branch: master
commit: b96e31477ca1e207aa1c0cdc334539b1f7d3a7f0
SSL: false
modules: adc,bit,cjson,cron,file,gpio,http,mqtt,net,node,ow,rtctime,sntp,tmr,uart,wifi
build built on: 2017-02-06 12:36
powered by Lua 5.1.4 on SDK 2.0.0(656edbf)
lua: cannot open init.lua
> print(uart.setup(0, 115200, 8, 0, 1, 1 ))
115200
> dofile(«script1.lua»)
work now!
get t
Got 374
Got 374
script1.lua:48: attempt to index global ‘rtcmem’ (a nil value)
stack traceback:
script1.lua:48: in function ‘publish_data’
script1.lua:104: in main chunk
[C]: in function ‘dofile’
stdin:1: in main chunk
> Get Sleep By Timer
Sleep Now!
-
Модуль rtcmem должен быть в прошивке, если вы его вызываете. А у вас его нет.
-
Пересобрал, щас походу как говорил гуру @ИгорьК
Ругается на таймер, помогите подправить его @serg3295release DTS: 202112300746
SSL: false
build type: float
LFS: 0x0 bytes total capacity
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi
build 2022-11-12 12:49 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)
cannot open init.lua:
> print(uart.setup(0, 115200, 8, 0, 1, 1 ))
115200
>
—————————-
ds18b20.lua : 1796 bytes
script1.lua : 3488 bytes
—————————-
Total file(s) : 2
Total size : 5284 bytesTotal : 3493920 bytes
Used : 6024 bytes
Remain: 3487896 bytes> dofile(«script1.lua»)
Lua error: script1.lua:99: attempt to call field ‘alarm’ (a nil value)
stack traceback:
script1.lua:99: in main chunk
[C]: in function ‘dofile’
stdin:1: in main chunk
[C]: ?
[C]: ?
> -
Там с новой прошивкой будут ещё косяки. Попробуйте сначала заказать прошивку 1.5 на сайте. Полагаю, это решит проблемы.
Иначе придётся код пересматривать весь заново. У меня в ближайшие дни такой возможности не будет.
DetSimen и serg3295 нравится это.
-
Пересобрал на 1.5, применил тестовый скрипт, температуру отправляет, ресетиться. Загружаю рабочую init.lua и данные передает тока при первом включение. Все, потом больше не передает. Время разное пробовал, все так же. При подаче питании один раз передает и все. Но через определенное время светодиод моргает, но не подключается. Что может быть?
-
init.lua файл:
ap = «R8»
appass = «UF»
pin = 4
sleepdelay = 300
killdelay = 35
countsleep = 3function sendNarod(temperature)
wifi.setmode(wifi.STATION)
wifi.sta.config(ap , appass)
wifi.sta.autoconnect(0)
tmr.alarm(0, 1000, 1, function()
if wifi.sta.status() == 5 and wifi.sta.getip() ~= nil then
tmr.stop(0)
local dataN = «#8E-CE-4E-E2-49-56n»
dataN =dataN..»#T01#»..temperature..»n»
dataN = dataN..»##n»
conn=net.createConnection(net.TCP, 0)
conn:on(«connection»,function(conn, payload)
conn:send(dataN)
end)
conn:on(«receive», function(conn, payload)
conn:close()
disconnect()
end)
conn:connect(8283,’narodmon.ru’)
end
end)
endfunction publish_data()
local t = 85
t = getTemp()
if t ~= 85 then
local oldt = rtcmem.read32(0)
local count = rtcmem.read32(1)
if (count + 1) < 1 then
rtcmem.write32(1, 0)
else
rtcmem.write32(1, (count+1))
end
rtcmem.write32(1, (count+1))
local delta = t — oldt
if delta < 0 then
delta = delta * -1
endif (delta >
or (count > countsleep) then
rtcmem.write32(0, t)
rtcmem.write32(1, 0)
if bit.isset(t, 15) then t = 1 — bit.bxor(t, 0xffff) end
t = t * 625 / 10000
sendNarod(t)
else
disconnect()
end
end
endfunction getTemp()
local t = 85
local ds18b20 = require(‘ds18b20’)
ds18b20.setup(pin)
local addres={}
addres=ds18b20.addrs()
if addres[1] ~= nil then
t = ds18b20.read(addres[1])
end
return t
endfunction disconnect()
tmr.alarm(3, 500, 0, function()
node.dsleep(1000000*sleepdelay, 4)
end)
end
tmr.alarm(5, 1000*killdelay, 0, function()
disconnect()
end)publish_data()
-
Вы там проводок на ресет подключили?
-
Конечно. Я так и думал, что вы это спросите. Щас мультиком прозвонил контакты все как положено. GPIO16-RST.
-
Еще раз пропаял всё, занова прошил опять. Всё так же, один раз при подаче питании тока данные передает. Прошил получается на готовом модуле где кнопка ресет и боот есть. Смотрел в файле настройке, и при нажатии ресет плата перезагружается, счетчики считают, а плата не подключается к вайфай. Тока при подаче питания один раз. @ИгорьК что может быть?
Последнее редактирование: 13 ноя 2022
-
Выкладывайте полный лог от подачи питания до того момента, когда вы решаете что оно не работает.
-
PORT OPEN 115200
Soft restart by user command
node.restart()
>
ets Jan 8 2013,rst cause:1, boot mode:(3,6)load 0x40100000, len 25004, room 16
tail 12
chksum 0x90
ho 0 tail 12 room 4
load 0x3ffe8000, len 2260, room 12
tail 8
chksum 0xc5
load 0x3ffe88d4, len 136, room 0
tail 8
chksum 0xe1
csum 0xe1
Дгд‚nм“{‚уo|дl$ld`Дгr›$Њd„юNodeMCU custom build by frightanic.com
branch: 1.5.4.1-final
commit: 9ad37255717e02120f43f213a892a845dbe40615
SSL: true
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi,tls
build created on 2022-11-12 13:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
lua: cannot open init.lua
> print(uart.setup(0, 115200, 8, 0, 1, 1 ))
115200
>
—————————-
ds18b20.lua : 1796 bytes
script1.lua : 3486 bytes
—————————-
Total file(s) : 2
Total size : 5282 bytesTotal : 3384986 bytes
Used : 6024 bytes
Remain: 3378962 bytes> dofile(«script1.lua»)
work now!
get t
Got 393
Got 393
oldt -1877804978
Delta 1877805371
count = 1025461554
countsleep = 1025461554
t = 24.5625
Pubish Data!
> Got wi-fi!
T = 24.5625
#8E-CE-4E-E2-49-56
#T01#24.5625
##Retrieved in 1950.197 milliseconds.
Narodmon says OKSleep Now!
NodeMCU custom build by frightanic.com
branch: 1.5.4.1-final
commit: 9ad37255717e02120f43f213a892a845dbe40615
SSL: true
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi,tls
build created on 2022-11-12 13:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
lua: cannot open init.lua
> dofile(«script1.lua»)
work now!
get t
Got 394
Got 394
oldt 393
Delta 1
count = 0
Not changes. Go…
> Sleep Now!NodeMCU custom build by frightanic.com
branch: 1.5.4.1-final
commit: 9ad37255717e02120f43f213a892a845dbe40615
SSL: true
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi,tls
build created on 2022-11-12 13:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
lua: cannot open init.lua
> dofile(«script1.lua»)
work now!
get t
Got 394
Got 394
oldt 393
Delta 1
count = 1
Not changes. Go…
> Sleep Now!NodeMCU custom build by frightanic.com
branch: 1.5.4.1-final
commit: 9ad37255717e02120f43f213a892a845dbe40615
SSL: true
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi,tls
build created on 2022-11-12 13:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
lua: cannot open init.lua
> dofile(«script1.lua»)
work now!
get t
Got 394
Got 394
oldt 393
Delta 1
count = 2
Not changes. Go…
> Sleep Now!NodeMCU custom build by frightanic.com
branch: 1.5.4.1-final
commit: 9ad37255717e02120f43f213a892a845dbe40615
SSL: true
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi,tls
build created on 2022-11-12 13:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
lua: cannot open init.lua
> dofile(«script1.lua»)
work now!
get t
Got 394
Got 394
oldt 393
Delta 1
count = 3
countsleep = 3
t = 24.625
Pubish Data!
> Get Sleep By Timer
Sleep Now!NodeMCU custom build by frightanic.com
branch: 1.5.4.1-final
commit: 9ad37255717e02120f43f213a892a845dbe40615
SSL: true
modules: adc,bit,file,gpio,mqtt,net,node,ow,rtcmem,rtctime,tmr,uart,wifi,tls
build created on 2022-11-12 13:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
lua: cannot open init.lua
> dofile(«script1.lua»)
work now!
get t
Got 393
Got 393
oldt 394
Delta 1
count = 0
Not changes. Go…
> Sleep Now! -
На третим должен был передать, не передает. Хоть какое время ожидание ставь. Только заново подать питание и ресет сделать, опять передаст.
Страница 1 из 3
-
#2
Недавно скачал Moonloader,чтобы опробовать хелпер для ловли( качал отсюда https://www.blast.hk/threads/39372/ ).
Запускаю самп, пытаюсь запустить этот хелпер,но ничего не происходит.
В SAMPFUNCS’е выходит такой лог:
[ML] (system) Check MoonLoader Updates: Loaded successfully.
[ML] (system) Loading script ‘D:äëÿ ñàìïàGrand Theft Auto — San AndreasmoonloaderHelperLovli (1).lua’…
[ML] (system) HelperLovli (1).lua: Loaded successfully.
[ML] (system) Loading script ‘D:äëÿ ñàìïàGrand Theft Auto — San Andreasmoonloaderimgui_notf (1).lua’…
[ML] (system) imgui_notf (1).lua: Loaded successfully.
[ML] (system) Loading script ‘D:äëÿ ñàìïàGrand Theft Auto — San Andreasmoonloaderreload_all.lua’…
[ML] (system) ML-ReloadAll: Loaded successfully.
[ML] (system) Loading script ‘D:äëÿ ñàìïàGrand Theft Auto — San AndreasmoonloaderSF Integration.lua’…
[ML] (system) SF Integration: Loaded successfully.
[ML] (system) Installing post-load hooks…
[ML] (system) Hooks installed.
Direct3DDevice9 hook installed.
Hook «SAMP: RakPeer::HandleRPCPacket» installed.
Initializing SAMP data…
Info initialized.
Pools initialized.
Player pool initialized.
Vehicle pool initialized.
Chat initialized.
Input initialized.
Death list initialized.
Dialog initialized.
Misc data initialized.
Scoreboard initialized.
RakNet initialized.
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1) completely loaded!
[ML] (error) HelperLovli (1).lua: … Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:165: attempt to call field ‘addNotification’ (a nil value)
stack traceback:
… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua: in function <… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:163>
stack traceback:
[C]: in function ‘create’
… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:163: in function <… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:161>
[ML] (error) HelperLovli (1).lua: Script died due to an error. (01C33A64)
[ML] (error) imgui_notf (1).lua: cannot resume non-suspended coroutine
stack traceback:
[C]: in function ‘SetMouseCursor’
…d Theft Auto — San Andreasmoonloaderimgui_notf (1).lua:103: in function <…d Theft Auto — San Andreasmoonloaderimgui_notf (1).lua:99>
[ML] (error) imgui_notf (1).lua: Script died due to an error. (01C4CF3C)
Никогда не пользовался Moonloader, помогите(
Установлены ли у тебя все стандарт библиотеки (папка lib в moonloader’e)
-
#3
Установлены ли у тебя все стандарт библиотеки (папка lib в moonloader’e)
вот содержимое lib
-
#4
У тебя далеко не все библиотеки установлены , <ссылка> , качаешь это и просто заменяешь эту папку на свою
-
#5
У тебя далеко не все библиотеки установлены , <ссылка> , качаешь это и просто заменяешь эту папку на свою
не помогает
лог:
[ML] (system) Check MoonLoader Updates: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San AndreasmoonloaderHelperLovli (1).lua’…
[ML] (system) HelperLovli (1).lua: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San Andreasmoonloaderimgui_notf (1).lua’…
[ML] (system) imgui_notf (1).lua: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San Andreasmoonloaderreload_all.lua’…
[ML] (system) ML-ReloadAll: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San AndreasmoonloaderSF Integration.lua’…
[ML] (system) SF Integration: Loaded successfully.
[ML] (system) Installing post-load hooks…
[ML] (system) Hooks installed.
Direct3DDevice9 hook installed.
Hook «SAMP: RakPeer::HandleRPCPacket» installed.
Initializing SAMP data…
Info initialized.
Pools initialized.
Player pool initialized.
Vehicle pool initialized.
Chat initialized.
Input initialized.
Death list initialized.
Dialog initialized.
Misc data initialized.
Scoreboard initialized.
RakNet initialized.
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1) completely loaded!
[ML] (error) HelperLovli (1).lua: … Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:165: attempt to call field ‘addNotification’ (a nil value)
stack traceback:
… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua: in function <… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:163>
stack traceback:
[C]: in function ‘create’
… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:163: in function <… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:161>
[ML] (error) HelperLovli (1).lua: Script died due to an error. (01BBDEF4)
[ML] (error) imgui_notf (1).lua: cannot resume non-suspended coroutine
stack traceback:
[C]: in function ‘SetMouseCursor’
…d Theft Auto — San Andreasmoonloaderimgui_notf (1).lua:103: in function <…d Theft Auto — San Andreasmoonloaderimgui_notf (1).lua:99>
[ML] (error) imgui_notf (1).lua: Script died due to an error. (01BBE07C)
-
#6
не помогает
лог:
[ML] (system) Check MoonLoader Updates: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San AndreasmoonloaderHelperLovli (1).lua’…
[ML] (system) HelperLovli (1).lua: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San Andreasmoonloaderimgui_notf (1).lua’…
[ML] (system) imgui_notf (1).lua: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San Andreasmoonloaderreload_all.lua’…
[ML] (system) ML-ReloadAll: Loaded successfully.
[ML] (system) Loading script ‘D:для сампаGrand Theft Auto — San AndreasmoonloaderSF Integration.lua’…
[ML] (system) SF Integration: Loaded successfully.
[ML] (system) Installing post-load hooks…
[ML] (system) Hooks installed.
Direct3DDevice9 hook installed.
Hook «SAMP: RakPeer::HandleRPCPacket» installed.
Initializing SAMP data…
Info initialized.
Pools initialized.
Player pool initialized.
Vehicle pool initialized.
Chat initialized.
Input initialized.
Death list initialized.
Dialog initialized.
Misc data initialized.
Scoreboard initialized.
RakNet initialized.
SAMPFUNCS v5.4.1-final rel.21 (SA-MP 0.3.7-R1) completely loaded!
[ML] (error) HelperLovli (1).lua: … Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:165: attempt to call field ‘addNotification’ (a nil value)
stack traceback:
… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua: in function <… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:163>
stack traceback:
[C]: in function ‘create’
… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:163: in function <… Theft Auto — San AndreasmoonloaderHelperLovli (1).lua:161>
[ML] (error) HelperLovli (1).lua: Script died due to an error. (01BBDEF4)
[ML] (error) imgui_notf (1).lua: cannot resume non-suspended coroutine
stack traceback:
[C]: in function ‘SetMouseCursor’
…d Theft Auto — San Andreasmoonloaderimgui_notf (1).lua:103: in function <…d Theft Auto — San Andreasmoonloaderimgui_notf (1).lua:99>
[ML] (error) imgui_notf (1).lua: Script died due to an error. (01BBE07C)
пробовал переустанавливать скрипт?
-
#7
пробовал переустанавливать скрипт?
Переустановил, проверил и всё работает. Спасибо огромное.
Attempt to call a nil value
Attempt to call a nil value
Description: calling a function that doesn’t exist
printtt(«abc») — printtt is not a function
test() — calling before it’s defined, same error
Unexpected symbol near ‘something’
Unexpected symbol near ‘something’
Description: an invalid character is placed next to a value/keyword/variable/function call
function abc()) end — unexpected symbol near ‘)’
a l= 15 — unexpected symbol near ‘l’
local a = 5] — unexpected symbol near ‘]’
Attempt to index global ‘variable’ (a nil value)
Attempt to index global ‘variable’ (a nil value)
Description: indexing via [key]
or .key
for a variable that doesn’t exist
abc.x = 5 — abc is nil, error
abc = {} — abc defined here
xyz[‘x’] = ‘abc’ — xyz is nil, error
Attempt to perform arithmetic on a nil value
Attempt to perform arithmetic on a nil value
Description: performing arithmetic (*, /, -, +, %, ^) on a nil value
print(xyz + 5) — error, xyz not defined
a = a + 5 — error, a not defined
Attempt to perform arithmetic on field ‘?’ (a nil value)
Attempt to perform arithmetic on field ‘?’ (a nil value)
Description: performing arithmetic (*, /, -, +, %, ^) on a nil value
Attempt to compare nil with <TYPE>
Attempt to compare nil with <TYPE>
Description: using a comparison operator (<, >, ~=, ==, >=, <=) in which one side is a nil value
print(x < y) — y is not defined
Malformed number near <NUMBER>
Malformed number near <NUMBER>
Description: the number has an invalid character next to it
print(12345aaa) — aaa makes it a malformed number
Unfinished capture | Malformed pattern
Unfinished capture | Malformed pattern
Description: the pattern is missing a closing )
, or a closing ]
print(string.match(‘ABC’, ‘(‘)) — unfinished capture
print(string.match(‘ABC’, ‘[‘)) — malformed pattern
When you get an error, Lua provides a stack trace showing you where it originates from, where the error occurs, the function calls that led to the error, and the line number of where it occurred.
A general error will look like this:
file_location:LINE NUMBER: error message
file_location:LINE NUMBER: in <local/function> ‘FUNC’
file_location:LINE NUMBER: in main chunk
C:Usersuserlua_file.lua:5: attempt to perform arithmetic on a nil value (field ‘x’)
C:Usersuserlua_file.lua:5: in local ‘c’
C:Usersuserlua_file.lua:7: in local ‘b’
C:Usersuserlua_file.lua:9: in function ‘a’
C:Usersuserlua_file.lua:12: in main chunk
The code that resulted in this error is:
Here you can see the line number 5
after the file location, which tells us where the exact line with the code that resulted in the error. The stack traceback shows the functions that were called that led up to that.
First, function a
is called at line 12, then function b
is called at line 9 inside of a
, then c
is called at line 7 inside of function b
, and finally at line 5, the error occurs inside of function c
.
A note to add is that comments can offset the line number and make it appear as the error is in a line that doesn’t exist or doesn’t look like an error,
ВНИМАНИЕ! КОММЕНТАРИИ ПЕРВОГО УРОВНЯ В ВОПРОСАХ УПОРЯДОЧИВАЮТСЯ ПО ЧИСЛУ ПЛЮСИКОВ, А НЕ ПО ВРЕМЕНИ ПУБЛИКАЦИИ.
local stopped = false
function OnStop()
stopped = true
return 2000
end
function main ()
local SecCode = «GZZ9»
local PriceRTSBuy = getParamEx(«SPBFUT», SecCode, «LAST»).param_value
local LimitOrderBuy = {
[«ACTION»] =«NEW_ORDER»,
[«ACCOUNT»] =«SPBFUT000ve»,
[«OPERATION»] =«B»,
[«CLASSCODE»] =«SPBFUT»,
[«SECCODE»] = SecCode,
[«PRICE»] = (PriceRTSBuy — 50),
[«QUANTITY»] = 1,
[«TRAND_ID»] = 228322,
}
local Err_Order=SendTransaction(LimitOrderBuy)
message («Err_Order»)
end
- 27 сентября 2019, 21:01
-
Ответить
Hired, тут куча ошибок!
1) функция message должна иметь формат message(«Текст сообщения»,1)
2) в PriceRTSBuy Вы получаете строку, а вычитаете число. Может прокатить, а может быть баг. Нужно tostring(tonumber(PriceRTSBuy)-50)
3)[«QUANTITY»] = «1», — в ключ количество нужно передавать строку
4) Номер транзакции тоже нужно взять в кавычки, т.е. дать строку
- 27 сентября 2019, 21:14
-
Ответить
pessimist, не помогло. указывает на ошибку в строке local Err_Order=SendTransaction(LimitOrderBuy). А если удалить её и message, то после запуска ничего не происходит и никакой реакции нет
- 27 сентября 2019, 21:20
-
Ответить
Hired, а какую ошибку указывает, можно скрин?
- 27 сентября 2019, 21:22
-
Ответить
pessimist, [«QUANTITY»] = tostring(1) тоже не помогает.
ошибка: …script qluaza9vka vistavlenie.lua:20: attempt to call global ‘SendTransaction’ (a nil value), 20я строка это local Err_Order=SendTransaction(LimitOrderBuy)
- 27 сентября 2019, 21:24
-
Ответить
Hired, регистр имеет важное значение, Вы неправильно написали функцию :
sendTransaction
Первая буква должна быть маленькой
- 27 сентября 2019, 21:26
-
Ответить
pessimist, хаха вот фэйл! спасибо! видимо на сегодня пора заканчивать
- 27 сентября 2019, 21:29
-
Ответить
Hired,
всегда — пожалуйста!
- 27 сентября 2019, 21:29
-
Ответить
local stopped = false
function OnStop()
stopped = true
return 2000
end
function main ()
local SecCode = «GZZ9»
local PriceRTSBuy = getParamEx(«SPBFUT», SecCode, «LAST»).param_value
local LimitOrderBuy = {
[«ACTION»] =«NEW_ORDER»,
[«ACCOUNT»] =«SPBFUT000ve»,
[«OPERATION»] =«B»,
[«CLASSCODE»] =«SPBFUT»,
[«SECCODE»] = SecCode,
[«PRICE»] = (PriceRTSBuy — 50),
[«QUANTITY»] = 1,
[«TRAND_ID»] = 228322,
}
local Err_Order=SendTransaction(LimitOrderBuy)
message («Err_Order»)
end
- 27 сентября 2019, 21:01
-
Ответить
Hired, тут куча ошибок!
1) функция message должна иметь формат message(«Текст сообщения»,1)
2) в PriceRTSBuy Вы получаете строку, а вычитаете число. Может прокатить, а может быть баг. Нужно tostring(tonumber(PriceRTSBuy)-50)
3)[«QUANTITY»] = «1», — в ключ количество нужно передавать строку
4) Номер транзакции тоже нужно взять в кавычки, т.е. дать строку
- 27 сентября 2019, 21:14
-
Ответить
pessimist, не помогло. указывает на ошибку в строке local Err_Order=SendTransaction(LimitOrderBuy). А если удалить её и message, то после запуска ничего не происходит и никакой реакции нет
- 27 сентября 2019, 21:20
-
Ответить
Hired, а какую ошибку указывает, можно скрин?
- 27 сентября 2019, 21:22
-
Ответить
pessimist, [«QUANTITY»] = tostring(1) тоже не помогает.
ошибка: …script qluaza9vka vistavlenie.lua:20: attempt to call global ‘SendTransaction’ (a nil value), 20я строка это local Err_Order=SendTransaction(LimitOrderBuy)
- 27 сентября 2019, 21:24
-
Ответить
Hired, регистр имеет важное значение, Вы неправильно написали функцию :
sendTransaction
Первая буква должна быть маленькой
- 27 сентября 2019, 21:26
-
Ответить
pessimist, хаха вот фэйл! спасибо! видимо на сегодня пора заканчивать
- 27 сентября 2019, 21:29
-
Ответить
Hired,
всегда — пожалуйста!
- 27 сентября 2019, 21:29
-
Ответить
Только зарегистрированные и авторизованные пользователи могут оставлять ответы.
Залогиниться
Зарегистрироваться