"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[904],{7403:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>i,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>t,toc:()=>o});const t=JSON.parse('{"id":"XXTLanControl.lua/assist/cancel","title":"Cancel One Request (LCC.assist.cancel)","description":"Declaration","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/assist/cancel.md","sourceDirName":"XXTLanControl.lua/assist","slug":"/XXTLanControl.lua/assist/cancel","permalink":"/docs/en/XXTLanControl.lua/assist/cancel","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":70,"frontMatter":{"sidebar_position":70},"sidebar":"tutorialSidebar","previous":{"title":"Request Remote Control (LCC.assist.request_control)","permalink":"/docs/en/XXTLanControl.lua/assist/request_control"},"next":{"title":"Cancel Current Script Requests (LCC.assist.cancel_all)","permalink":"/docs/en/XXTLanControl.lua/assist/cancel_all"}}');var l=s(4848),r=s(8453);const a={sidebar_position:70},c="Cancel One Request (LCC.assist.cancel)",i={},o=[{value:"Declaration",id:"declaration",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Return Values",id:"return-values",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function u(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"cancel-one-request-lccassistcancel",children:"Cancel One Request (LCC.assist.cancel)"})}),"\n",(0,l.jsx)(n.h2,{id:"declaration",children:"Declaration"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"ok, err, task = LCC.assist.cancel(id, timeout?)\n"})}),"\n",(0,l.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["id",(0,l.jsx)(n.br,{}),"\n","String. Assist request ID."]}),"\n",(0,l.jsxs)(n.li,{children:["timeout",(0,l.jsx)(n.br,{}),"\n","Number, optional. Cancel request timeout in seconds. Defaults to ",(0,l.jsx)(n.code,{children:"10"}),"."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"return-values",children:"Return Values"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["ok",(0,l.jsx)(n.br,{}),"\n","Boolean. ",(0,l.jsx)(n.code,{children:"true"})," when cancellation succeeds; otherwise ",(0,l.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:["err",(0,l.jsx)(n.br,{}),"\n","String or ",(0,l.jsx)(n.code,{children:"nil"}),". Failure reason."]}),"\n",(0,l.jsxs)(n.li,{children:["task",(0,l.jsx)(n.br,{}),"\n","Table or ",(0,l.jsx)(n.code,{children:"nil"}),". The cancelled task object."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsxs)(n.p,{children:["Cancels one unfinished assist request.",(0,l.jsx)(n.br,{}),"\n","The request is also removed from the current script's unfinished request set."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:'local ok, err, task = LCC.assist.cancel(taskId)\nif not ok then\n    nLog("failed to cancel assist request", err)\nend\n'})})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(u,{...e})}):u(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>c});var t=s(6540);const l={},r=t.createContext(l);function a(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);